Conversation
qihqi
approved these changes
May 20, 2024
JackCaoG
reviewed
May 20, 2024
zpcore
pushed a commit
that referenced
this pull request
May 20, 2024
Collaborator
|
I wonder what error did you see before this fix. |
Collaborator
Author
Traceback (most recent call last):
File "xla/benchmarks/experiment_runner.py", line 945, in <module>
main()
File "xla/benchmarks/experiment_runner.py", line 941, in main
runner.run()
File "xla/benchmarks/experiment_runner.py", line 61, in run
self.run_single_config()
File "xla/benchmarks/experiment_runner.py", line 256, in run_single_config
metrics, last_output = self.run_once_and_gather_metrics(
File "xla/benchmarks/experiment_runner.py", line 345, in run_once_and_gather_metrics
output, _ = loop(iter_fn=self._default_iter_fn)
File "xla/benchmarks/experiment_runner.py", line 302, in loop
output, timing, trace = iter_fn(benchmark_experiment, benchmark_model,
File "xla/benchmarks/experiment_runner.py", line 218, in _default_iter_fn
output = benchmark_model.model_iter_fn(
File "xla/benchmarks/torchbench_model.py", line 411, in train
super().train(inputs, collect_full_output=collect_full_output)
File "xla/benchmarks/benchmark_model.py", line 160, in train
loss.backward()
File "torch/_tensor.py", line 523, in backward
torch.autograd.backward(
File "torch/autograd/__init__.py", line 267, in backward
_engine_run_backward(
File "torch/autograd/graph.py", line 767, in _engine_run_backward
return Variable._execution_engine.run_backward( # Calls into the C++ engine to run the backward pass
RuntimeError: value cannot be converted to type at::Half without overflow |
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.
This PR fixes the
div(Tensor, Scalar)operation implementation.Problem: consider
div(tensor(..., dtype=half), 1_000_000)GetIrValueForScalarwill attempt to convert the scalar into a tensor ofdtype=half1_000_000is beyondhalfmax valueSolution: use another type for these mathematical operations
at::OpMathTypetraitAffected Benchmarks
cc @miladm @JackCaoG