-
Notifications
You must be signed in to change notification settings - Fork 478
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
[Neuron] Fix the XLADevice Neuron mappings for SPMD downcasts #8335
Conversation
418c0c0
to
145d3d5
Compare
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 comment
The 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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
Currently, the downcasting mappings based on the XLA device types does not account for virtual devices (SPMD), when requiring Neuron specific casts. The same applies to the lowering and native functions. This PR fixes it by deriving the proper hardware device.