Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Op][Trans2] Full/FullLike, Zeros/ZerosLike, Ones/OnesLike #79

Merged
merged 3 commits into from
Jan 1, 2023

Conversation

MasterJH5574
Copy link
Member

Following #78, this PR is the second part of transformation operator migration, as listed in #62.

It contains operators

  • Cast
  • Full / FullLike
  • Zeros / ZerosLike
  • Ones / OnesLike

Migrate these op first to unblock some parallelism on, like, auto differentiation.

@MasterJH5574
Copy link
Member Author

Depends on #78 yet

python/tvm/relax/op/transform.py Outdated Show resolved Hide resolved
python/tvm/relax/op/transform.py Outdated Show resolved Hide resolved
python/tvm/relax/op/transform.py Outdated Show resolved Hide resolved
python/tvm/relax/op/transform.py Outdated Show resolved Hide resolved
python/tvm/relax/op/transform.py Outdated Show resolved Hide resolved
@MasterJH5574 MasterJH5574 changed the title [Op][Trans2] Cast, Full/FullLike, Zeros/ZerosLike, Ones/OnesLike [Op][Trans2] Full/FullLike, Zeros/ZerosLike, Ones/OnesLike Jan 1, 2023
@MasterJH5574
Copy link
Member Author

MasterJH5574 commented Jan 1, 2023

Rebased this PR and addressed the comments above. Several notes:

  1. Removed Cast from this PR as it is brought by [Op] cast, wrap_param #75 already.
  2. Removed some duplicate tests, which are due to the recent organization of namespace.
  3. Move Full/FullLike, Ones/OnesLike and Zeros/ZerosLike from namespace “transform” to “create”, according to DataAPI where they are categorized as “creation functions”. https://data-apis.org/array-api/latest/API_specification/creation_functions.html
  4. Disabled the case of having single int/PrimExpr as the input new shape, per [Op][Trans2] Full/FullLike, Zeros/ZerosLike, Ones/OnesLike #79 (comment). Also disabled this for Reshape. Added regression tests for this case.
  5. Updated the Python type annotation of dtype from str to Union[str, DataType], per [Op] cast, wrap_param #75 (comment).
  6. Reordered the parameters of Full, putting the shape in front of the fill-value, per [Op][Trans2] Full/FullLike, Zeros/ZerosLike, Ones/OnesLike #79 (comment).

@tqchen @Ubospica @SiriusNEO Thanks for reviewing so far. See if you have further comments :-)

@tqchen tqchen merged commit 6b8c374 into mlc-ai:structinfo Jan 1, 2023
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.

4 participants