-
Notifications
You must be signed in to change notification settings - Fork 35
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
Make Autograph support in-place assignments with static slice(start, stop, step)
#843
Conversation
**Context:** Make ``y[start: stop] = x`` work. Must be used with ``https://github.com/PennyLaneAI/catalyst/pull/843``. **Description of the Change:** **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** PennyLaneAI/catalyst#516 (comment) [sc-60315]
We might want to push a new release of malt before merging this PR :) @josh146 |
@tzunghanjuang This needs an update because we decided against using dynamic_update_slice right? |
@dime10 Yes, I am still looking for the alternative. |
Only allowing static indices right? |
Yes |
IndexError
related to dynamic slice with jax and autographIndexError
related to slice (Static Only) with jax and autograph
@dime10 I have updated the set_item primitive and tests. |
IndexError
related to slice (Static Only) with jax and autographslice(start, stop, step)
slice(start, stop, step)
slice(start, stop, step)
slice(start, stop, step)
slice(start, stop, step)
slice(start, stop, step)
slice(start, stop, step)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Just needs a changelog and a minimum version bump on the malt dependency :)
The malt package has been updated btw :) https://pypi.org/project/diastatic-malt/ |
HI @dime10. What should be the category for PR? (Feature, improvement or bug fix?) |
Usually we don't triage PRs by what kind they are (although if you really want to you can). Instead, we assign which part of the project the PR is modifying (docs, ci, frontend, compiler, runtime). The classification (improvement, bug, etc) is usually used for issues. EDIT: Oh are you referring to the changelog? In that case I think it is an improvement (since it improves the existing feature array assignment feature) :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tzunghanjuang :)
slice(start, stop, step)
slice(start, stop, step)
slice(start, stop, step)
slice(start, stop, step)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #843 +/- ##
=======================================
Coverage 97.98% 97.99%
=======================================
Files 71 71
Lines 10546 10548 +2
Branches 960 961 +1
=======================================
+ Hits 10334 10336 +2
Misses 169 169
Partials 43 43 ☔ View full report in Codecov by Sentry. |
Context:
Make
set_item
primitive detectslice
.If yes, usedynamic_update_slice
.Must be used with PennyLaneAI/diastatic-malt#6.
Update (2024/07/12): We no longer consider
dynamic_update_slice
as an option since it produces unwanted results if the indices are out-of-range.Description of the Change:
Malt
package has a new implementation forslice(start, stop, step)
. We have to capture such arguments.Possible Drawbacks:
If the length of assignment does not match,jax.lax.dynamic_update_slice
will adjust the starting point.Related GitHub Issues:
#516
[sc-60315]