-
Notifications
You must be signed in to change notification settings - Fork 547
[Neuron] Fix the XLADevice Neuron mappings for SPMD downcasts #8335
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,19 +129,19 @@ xla::PrimitiveType MaybeDowncastToXlaDeviceType( | |
if (UseBF16()) { | ||
return xla::PrimitiveType::BF16; | ||
} | ||
if (DowncastBF16() || hw_type == XlaDeviceType::NEURON) { | ||
if (DowncastBF16() || CheckNeuronDevice(hw_type)) { | ||
return xla::PrimitiveType::F32; | ||
} | ||
return xla::PrimitiveType::F64; | ||
case xla::PrimitiveType::F32: | ||
return UseBF16() || DowncastBF16() ? xla::PrimitiveType::BF16 | ||
: xla::PrimitiveType::F32; | ||
case xla::PrimitiveType::U16: | ||
return hw_type != XlaDeviceType::NEURON ? xla::PrimitiveType::U16 | ||
: xla::PrimitiveType::U32; | ||
return CheckNeuronDevice(hw_type) ? xla::PrimitiveType::U32 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does the deprecating of the XLA casting env variables affect this at all? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, this change only affects the check for the device type, not the downcast flag check(or the deprecation of those flags). Since the pre-existing logic incorporated the deprecated flags, the current one does the same. The flags being deprecated will not affect this downcasting check change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks |
||
: xla::PrimitiveType::U16; | ||
case xla::PrimitiveType::S16: | ||
return hw_type != XlaDeviceType::NEURON ? xla::PrimitiveType::S16 | ||
: xla::PrimitiveType::S32; | ||
return CheckNeuronDevice(hw_type) ? xla::PrimitiveType::S32 | ||
: xla::PrimitiveType::S16; | ||
case xla::PrimitiveType::S64: | ||
return xla::PrimitiveType::S64; | ||
case xla::PrimitiveType::U64: | ||
|
Uh oh!
There was an error while loading. Please reload this page.