Skip to content

Conversation

@amd-eochoalo
Copy link
Contributor

@amd-eochoalo amd-eochoalo commented Nov 24, 2025

No description provided.

@github-actions
Copy link

github-actions bot commented Nov 24, 2025

🐧 Linux x64 Test Results

  • 7140 tests passed
  • 594 tests skipped


let summary = "TODO";
let description = [{
TODO
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

custom<DynamicIndexList>($atomic_barrier_dynamic_indices, $atomic_barrier_static_indices)
`:` type($atomic_barrier_address) `)`)?
( `iterate` $global_increment^ `,` $lds_increment `,` $iteration_count )?
attr-dict `:` qualified(type($base)) `to` type(results)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here

Comment on lines 69 to 70
printer << staticSize.getValue();
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: return early and no else

Comment on lines 1250 to 1251
found in TensorLoadToLDSOp and TensorStoreFromLDSOp in the rocdl dialect.
}];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also add an mlir example?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping on this

Comment on lines 57 to 58
int64_t staticVal;
if (parser.parseOptionalInteger(staticVal).has_value()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit/optional: you could push the definition inside the if, since it not used elsewhere

Suggested change
int64_t staticVal;
if (parser.parseOptionalInteger(staticVal).has_value()) {
if (int64_t staticVal; parser.parseOptionalInteger(staticVal).has_value()) {

@github-actions
Copy link

github-actions bot commented Nov 24, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@amd-eochoalo amd-eochoalo requested a review from kuhar November 25, 2025 14:10
Comment on lines 1250 to 1251
found in TensorLoadToLDSOp and TensorStoreFromLDSOp in the rocdl dialect.
}];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping on this

2D and 3D tensors may be iterated over by setting $global_increment, $lds_increment, and $iteration_count.
$global_increment determines how much to increment the starting global memory address per iteration in units of the $base's element type.
$lds_increment determines how much to increment the starting LDS address per iteration in units of the $base's element type.
$iterate_count determines how many times to iterate.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here: can you add a few mlir examples?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a few examples, I will ask for clarification on iteration.

Comment on lines 59 to 60
OptionalParseResult parseResult = parser.parseOptionalInteger(staticVal);
if (parseResult.has_value()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: why do we need this as a local variable, instead of using in the if condition like before?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//===----------------------------------------------------------------------===//

LogicalResult MakeDmaDescriptorOp::verify() {
if (getGlobalStaticStrides()->back() != 1) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does something else already guarantee there's at least one element?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amd-eochoalo amd-eochoalo requested a review from kuhar November 25, 2025 15:35
Copy link
Member

@kuhar kuhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but wait from a stamp from @krzysz00 before merging


// TODO: Define a custom printer, parser to avoid space between $src/%dst and indices.
let assemblyFormat = [{
$src custom<DynamicIndexList>($src_indices, $src_indices_const) `,`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is out of date

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arguments<(ins
AMDGPU_TDMBaseType: $base,
Variadic<Index>: $global_dynamic_sizes,
OptionalAttr<DenseI64ArrayAttr>: $global_static_sizes,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Existing examples of a similar pattern - subview, for example, don't use an optional here

(The static indices array must have a fixed length and use -1 to refer to dynamic dimensions)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OptionalAttr<IndexAttr>: $every_const,
Optional<AnyMemRef>: $atomic_barrier_address,
Variadic<Index>: $atomic_barrier_dynamic_indices,
OptionalAttr<DenseI64ArrayAttr>: $atomic_barrier_static_indices,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The atomic barrier part is more of a pure memref operation, and should probably just take Variadic<Index> (it's selecting a pointer, unlike all the other bits, which are doing size/strides/offsets subview-style)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional<Index>: $pad,
OptionalAttr<IndexAttr>: $pad_const,
Optional<Index>: $every,
OptionalAttr<IndexAttr>: $every_const,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can just be an optional index - doesn't need attribute splitting

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OptionalAttr<DenseI64ArrayAttr>: $shared_static_sizes,
Optional<Index>: $pad,
OptionalAttr<IndexAttr>: $pad_const,
Optional<Index>: $every,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's call this padEvery? Or something else more descriptive?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

} // namespace

static ParseResult
parseDynamicIndex(OpAsmParser &parser,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't need this

For the non-vararg cases, we can use an argument.

For the vararg cases (sizes, strides, etc.) we'll want to use the same machinery memref.subview does.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if (getGlobalStaticStrides()->back() != 1) {
return emitOpError("strides for the innermost dimension must be 1.");
}
return success();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing validation conditions: Number of strides == number of sizes == number of offsets, and the global and LDS tiles have the same dimensions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attr-dict `:` qualified(type($base)) `->` type(results)
}];

let hasVerifier = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll want the OpFoldResult helpers for combining the static/dynamic parts, I claim.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point here but let's leave that for the next PR which will add the lowering.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants