Skip to content

Commit

Permalink
[FRONTEND] Added comment on TensorSizeTrait::maxElement (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
ptillet authored Jul 25, 2022
1 parent 7eda373 commit 27c9f3d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/triton/Dialect/Triton/IR/Traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ class TensorSizeTrait : public TraitBase<ConcreteType, TensorSizeTrait> {
public:
// TODO: move impl to .cc files
static LogicalResult verifyTrait(Operation *op) {
// The rationale for this number is to prevent users from creating programs
// that would have catastrophic register pressure and cause the compiler to
// hang.
// Since H100 has 256KB registers, we should allow users to create tensors
// of size up to 256K elements. It will spill for datatypes wider than 1B,
// but we probably should limit number of elements (rather than bytes) to
// keep specs simple
int constexpr maxElement = 1048576;
for (auto opType : op->getOperandTypes()) {
if (auto tensorType = opType.dyn_cast<RankedTensorType>()) {
Expand Down

0 comments on commit 27c9f3d

Please sign in to comment.