Skip to content

Make cpu tensor on XLA dynamo backend a warning instead of error#5549

Merged
JackCaoG merged 1 commit intomasterfrom
JackCaoG/dynamo_warning
Sep 8, 2023
Merged

Make cpu tensor on XLA dynamo backend a warning instead of error#5549
JackCaoG merged 1 commit intomasterfrom
JackCaoG/dynamo_warning

Conversation

@JackCaoG
Copy link
Copy Markdown
Collaborator

@JackCaoG JackCaoG commented Sep 8, 2023

Logic in fallback partitioner(

if isinstance(arg, torch.Tensor) and not is_xla_tensor(arg):
self._fallback_ops.append(n)
break
) actually can handle the non-xla tensor. Instead of throwing a runtime error, it is better to throw a warning.

I run into this when trying to enable the HF stablediffusion with HF, there is one place it hardcoded a CPU tensor. Instead of raising a runtime error, let partitioner fallback is a better UX I think. Will need to backport this change to the release branch.

@JackCaoG JackCaoG merged commit e51d28b into master Sep 8, 2023
will-cromar added a commit that referenced this pull request Sep 19, 2023
* Handle dynamo function without input (#5565) (#5577)

* Make cpu tensor on XLA dynamo backend a warning instead of error (#5549) (#5576)

* [author: jluntamazon] Adding more explicit HLO lowering control by exposing LoweringContext… (#5431) (#5580)

* Adding more explicit HLO lowering control by exposing LoweringContext (and utilities) to python for Neuron

* fixing linter issues

* fixing spacing

* apply comments and fix compilation errors

* add test for new apis

* fix linter

* update test

* update test

* modify test

* reverse back to GetIrValue()

* update test inputs with random numbers

* skip unittest because it only fails in CI

---------

Co-authored-by: aws-kingrj <78175353+aws-kingrj@users.noreply.github.com>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-3-186.us-west-2.compute.internal>
Co-authored-by: seanlatias <seanlatias@gmail.com>

* fixing num_local_processes typo (#5573) (#5579)

Co-authored-by: aws-kingrj <78175353+aws-kingrj@users.noreply.github.com>

* Move where clear pending IR is called to avoid crash (#5552) (#5582)

* Move where clear pending IR is called to avoid crash

* fix CI

* fix CI and add some debugging messages

* Fix release branch and tag patterns for GitHub Actions (#5587) (#5590)

* Improve bernoulli rng-bit-generation memory footprint (#5581) (#5589)

* Allow downcasting RngUniform genenration for Bernoulli

Co-authored-by: Yeounoh Chung <yeounoh@google.com>

* Enable xla:gpu autocast for bfloat16 if not restricted (#5570) (#5591)

* Enable autocast for XLA:GPU

* linter fix

* XLA autocast test for GPU and TPU

* linter fix

* Ensure that xla autocast is properly enabled for GPU and does not crash when torch cuda is not available.

* linter fix

* Add tests

* Support bf16

* linter fix

* exclude unsupported test cases

* increase GPU test timeout to 300

Co-authored-by: Yeounoh Chung <yeounoh@google.com>

* Cherry-pick: Don't trigger CI build on release tag push (#5595)

Copy of #5594 on release branch

* formatting

---------

Co-authored-by: JackCaoG <59073027+JackCaoG@users.noreply.github.com>
Co-authored-by: Wonjoo Lee <wonjoo@google.com>
Co-authored-by: aws-kingrj <78175353+aws-kingrj@users.noreply.github.com>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-3-186.us-west-2.compute.internal>
Co-authored-by: seanlatias <seanlatias@gmail.com>
Co-authored-by: Manfei <41607353+ManfeiBai@users.noreply.github.com>
Co-authored-by: Yeounoh Chung <yeounoh@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants