-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
[TPU][V1] Disable per-request seed/Generator #16172
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
Conversation
|
👋 Hi! Thank you for contributing to the vLLM project. 💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels. Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can either: Add 🚀 |
|
Have you tried making the generator not on the device? It seems to work if I use a generator not on device to produce tensors on device >>> torch.randn((2,3), device=xm.xla_device())
tensor([[-0.2866, 0.0079, -3.2667],
[-0.2544, -0.3828, -3.1057]], device='xla:0')
>>> torch.randn((2,3), device=xm.xla_device(), generator=torch.Generator(device=xm.xla_device()))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: XLA device type not an accelerator.
>>> torch.randn((2,3), device=xm.xla_device(), generator=torch.Generator())
tensor([[ 0.9773, 1.1569, -0.3807],
[ 1.2525, -0.3068, -1.4705]], device='xla:0') |
|
Yep I was aware, xla generally falls back to cpu whenever it doesn't support some op, not sure why generator isn't the case here. In particular in the snippet you posted the graph looks smt like: Meaning XLA is just compiling some constant but not actually creating the random tensor on device. This will likely trigger recompilation when the traced constant changes. I think this is what this comment is about pytorch/xla#2532 (comment). Normally when you create a randn on device you see the whole sequence of ops being traced in the graph |
|
Thanks @NickLucche, @yaochengji may have some suggestions here. |
We have this error because we have a seperated device check logic in the sampler. see https://github.com/pytorch/pytorch/blob/6ea5514e0460604e4b0325a7218a7a8ca2e61819/aten/src/ATen/Context.h#L50. I'd like to suggest disabling generator logic for now also. |
885222a to
1025f93
Compare
1025f93 to
b3de56e
Compare
yaochengji
left a comment
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.
LGTM, thanks Nick!
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.
LGTM, but should we wait to land this until we can plug into #16291?
|
I will rebase on that |
Signed-off-by: NickLucche <nlucches@redhat.com>
Signed-off-by: NickLucche <nlucches@redhat.com>
Signed-off-by: NickLucche <nlucches@redhat.com>
Signed-off-by: NickLucche <nlucches@redhat.com>
b3de56e to
3733339
Compare
|
The TPU CI test failed with the error |
|
@yaochengji Thanks for the ping, my bad I forgot I added it back before I made seed requests error out |
Signed-off-by: NickLucche <nlucches@redhat.com>
Signed-off-by: NickLucche <nlucches@redhat.com>
Signed-off-by: NickLucche <nlucches@redhat.com> Signed-off-by: Yang Wang <elainewy@meta.com>
Signed-off-by: NickLucche <nlucches@redhat.com>
Signed-off-by: NickLucche <nlucches@redhat.com>
Signed-off-by: NickLucche <nlucches@redhat.com> Signed-off-by: Mu Huai <tianbowen.tbw@antgroup.com>
Fix #15833.
when setting a per-request seed.
I've looked into using a per-request
set_rng_statebut this doesn't look to be very efficient. I think we should just disable per-request seed for now.Update:
I brought back the
test_custom_dispatcher.pyin CI as I figured this was off due to the issue above.