Skip to content

PyTorch/XLA shouldn't crash on XLA errors #9096

@zhanyong-wan

Description

@zhanyong-wan

🐛 Bug

If XLA fails to compile a program and returns a Status error, PyTorch/XLA should handle it gracefully (e.g. by raising an appropriate Python exception) instead of crashing.

To Reproduce

See

executable =
client_->CompileAndLoad(mlir_module, compile_options).value();
StableHloCompileCounter()->AddValue(1);
} else {
executable =
client_->CompileAndLoad(instance.computation, compile_options)
.value();
- CompileAndLoad(...).value() will crash if CompileAndLoad(...) returns an error. We should check for error before getting the value.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions