Skip to content

Add support for parsing torch.Generator in JIT#140489

Closed
antoniojkim wants to merge 2 commits intopytorch:mainfrom
antoniojkim:antoniojkim/140420
Closed

Add support for parsing torch.Generator in JIT#140489
antoniojkim wants to merge 2 commits intopytorch:mainfrom
antoniojkim:antoniojkim/140420

Conversation

@antoniojkim
Copy link
Collaborator

@antoniojkim antoniojkim commented Nov 13, 2024

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 13, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/140489

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit 4b6c913 with merge base a8a1e58 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added the release notes: jit release notes category label Nov 13, 2024
@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Nov 13, 2024
@antoniojkim antoniojkim requested a review from albanD November 13, 2024 01:27
@soulitzer soulitzer added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Nov 13, 2024
Copy link
Contributor

@davidberard98 davidberard98 left a comment

Choose a reason for hiding this comment

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

LGTM, can you add a few more tests though?

test/test_jit.py Outdated
Copy link
Contributor

@davidberard98 davidberard98 Nov 13, 2024

Choose a reason for hiding this comment

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

iiuc seed can be in [-2^63, 2^64) or perhaps [0, 2^64). Can you test some large seeds to see if the parser works?

e.g.:

  • if you serialize a torchscript graph for a generator with a negative seed, is its value remapped to a positive value?
  • can the parser work with a seed > 2^63 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Technically seed can be [0, 2^64). However, the scalar parser only supports signed integers. So, the parser is constrained to [0, 2^63). However, that is good enough for my purposes. I've added tests for these cases

@davidberard98 davidberard98 added the ciflow/trunk Trigger trunk jobs on your pull request label Nov 13, 2024
@antoniojkim
Copy link
Collaborator Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

pobin6 pushed a commit to pobin6/pytorch that referenced this pull request Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged oncall: jit Add this issue/PR to JIT oncall triage queue open source release notes: jit release notes category triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TorchScript IR Parser does not support torch.Generator

6 participants