This is an archive of the discontinued LLVM Phabricator instance.

[mlir][GPU] Integer range inference for GPU index ops
AbandonedPublic

Authored by krzysz00 on Apr 19 2022, 11:03 AM.

Details

Summary

All GPU indices (thread ID, number of threads in a block, etc.) are
semantically non-negative, so we implement InferIntRangeInterface to
communicate this fact.

Depends on D124022

Depends on D124023

Depends on D124024

Diff Detail

Event Timeline

krzysz00 created this revision.Apr 19 2022, 11:03 AM
krzysz00 requested review of this revision.Apr 19 2022, 11:03 AM
Mogball added inline comments.
mlir/include/mlir/Dialect/GPU/InferIntRangeInterfaceImpl.h
17–18
mlir/include/mlir/InitAllDialects.h
109–111
mlir/test/Dialect/GPU/infer-int-range.mlir
25

could you add smaller tests for all the other ops you added the interface to?

krzysz00 abandoned this revision.May 26 2022, 1:55 PM

Abondoning, CUDA/HIP/... don't give a <= signed_max guarantee on workgroup ID. I will, however, be implementing InferIntRangeINterface downstream for our wrapper around the workgroup ID, where we _can_ make such guarantees (by way of saying "kernel's too big, sorry")