Skip to content

Conversation

@oskar-inceptron
Copy link
Contributor

The current code asserts that floormod(input_dims[0], num_shards) can not be proven to be true, which has two problems:

  • It is unclear what it means to prove floormod(..). Prove that floormod's return value is truthy, i.e. non-zero?
  • It always checks the 0th dimension of the input shape, but the dimension index to be sharded is given by the "axis" parameter.

This commit fixes both of the above.

The current code asserts that floormod(input_dims[0], num_shards) can
not be proven to be true, which has two problems:
- It is unclear what it means to prove floormod(..). Prove that
  floormod's return value is truthy, i.e. non-zero?
- It always checks the 0th dimension of the input shape, but the
  dimension index to be sharded is given by the "axis" parameter.
This commit fixes both of the above.
@Hzfengsy
Copy link
Member

cc @MasterJH5574 @tqchen

Copy link
Contributor

@MasterJH5574 MasterJH5574 left a comment

Choose a reason for hiding this comment

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

Thank you @oskar-inceptron!

@MasterJH5574 MasterJH5574 merged commit 5fc254e into apache:main Feb 28, 2025
10 checks passed
@oskar-inceptron oskar-inceptron deleted the fix/scatter_assert branch March 3, 2025 09:50
ShiboXing pushed a commit to ShiboXing/tvm that referenced this pull request Aug 10, 2025
The current code asserts that floormod(input_dims[0], num_shards) can
not be proven to be true, which has two problems:
- It is unclear what it means to prove floormod(..). Prove that
  floormod's return value is truthy, i.e. non-zero?
- It always checks the 0th dimension of the input shape, but the
  dimension index to be sharded is given by the "axis" parameter.
This commit fixes both of the above.
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