ENH: testing.lazy_xp_function: torch.compile support#668
Draft
lucascolley wants to merge 4 commits intodata-apis:mainfrom
Draft
ENH: testing.lazy_xp_function: torch.compile support#668lucascolley wants to merge 4 commits intodata-apis:mainfrom
torch.compile support#668lucascolley wants to merge 4 commits intodata-apis:mainfrom
Conversation
lucascolley
commented
Apr 3, 2026
Comment on lines
+534
to
536
| if jit_library is JitLibrary.jax and isinstance(obj, Iterator): | ||
| self._obj = list(obj) | ||
| self._is_iter = True |
Member
Author
There was a problem hiding this comment.
claude reckoned that, unlike JAX, we needn't treat iterables with this special case for torch.compile
Comment on lines
+424
to
+436
| wrapped = autojit(func, JitLibrary.jax) | ||
| # If we're dealing with a staticmethod or classmethod, make | ||
| # sure things stay that way. | ||
| if isinstance(attr, staticmethod): | ||
| wrapped = staticmethod(wrapped) | ||
| elif isinstance(attr, classmethod): | ||
| wrapped = classmethod(wrapped) | ||
| temp_setattr(target, name, wrapped) | ||
|
|
||
| elif is_torch_namespace(xp): | ||
| for target, name, attr, func, tags in iter_tagged(): | ||
| if tags["torch_compile"]: | ||
| wrapped = autojit(func, JitLibrary.torch) |
Member
Author
There was a problem hiding this comment.
(minor: could reduce some LoC perhaps)
Member
Author
|
@ev-br FYI |
lucascolley
commented
Apr 3, 2026
lucascolley
commented
Apr 3, 2026
Member
Author
lucascolley
left a comment
There was a problem hiding this comment.
I think the warnings about to flood CI should be fixed by data-apis/array-api-compat#411 (comment).
lucascolley
commented
Apr 3, 2026
Comment on lines
+90
to
+91
| [tool.pixi.pypi-dependencies] | ||
| array-api-compat = { git = "https://github.com/data-apis/array-api-compat", branch = "lucascolley-patch-1" } |
Member
Author
There was a problem hiding this comment.
let's see if data-apis/array-api-compat#413 is all we need to change in array-api-compat...
aaf86a5 to
393dd61
Compare
393dd61 to
cc4a106
Compare
Member
Author
|
ready for review |
This was referenced Apr 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes gh-664
@rgommers this was easier than I expected. Is there someone familiar with Dynamo that we could ping? A few things that came up:
torch.compile:(Draft PR as this will need docs updates before merge.)