-
Notifications
You must be signed in to change notification settings - Fork 25
Use dynamic values for AtomicOps #269
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
Conversation
458218d to
27db7bf
Compare
3f52c02 to
e989252
Compare
ba87142 to
c96ada3
Compare
c66c964 to
66c71f0
Compare
2fd2856 to
09a7262
Compare
|
|
||
| elements_per_thread: Optional[Any] = None | ||
| mapping: Optional[IndexMapping] = None | ||
| mapping_dynamic_vals: tuple[fx.Node, ...] = () |
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.
Unrelated to this PR exactly, but why does AtomicOp need to inherit from both BinaryOpBase and ABC, when BinaryOpBase has ABC in its inheritance chain? Just curious.
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.
good question, there are a couple of other classes with the same dependency. But thanks for pointing it out, I removed it for AtomicOp and everything seems fine.
willghatch
left a comment
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.
This looks reasonable to me.
99d7cd5 to
f6b50a3
Compare
Signed-off-by: Sanket Pandit <sanketp@amd.com> Signed-off-by: Sanket Pandit <sanket.pandit@amd.com>
Signed-off-by: Sanket Pandit <sanketp@amd.com> Signed-off-by: Sanket Pandit <sanket.pandit@amd.com>
Signed-off-by: Sanket Pandit <sanket.pandit@amd.com>
Signed-off-by: Sanket Pandit <sanket.pandit@amd.com>
Signed-off-by: Sanket Pandit <sanket.pandit@amd.com>
Signed-off-by: Sanket Pandit <sanket.pandit@amd.com>
Signed-off-by: Sanket Pandit <sanket.pandit@amd.com>
Signed-off-by: Sanket Pandit <sanket.pandit@amd.com>
Add dynamic indexing support for atomic operations in MoE alignment For the MoE align block, we need support for dynamically indexed values in atomic operations. This change introduces `mapping_dynamic_vals` parameter to AtomicOp and updates the atomic operation handler to support dynamic indexing. Key changes: - Add `mapping_dynamic_vals` parameter to atomic operations - Update `handle_atomic_op` decorator to process dynamic values - Convert dynamic registers to index-typed vectors and extract scalar indices - Pass dynamic value dictionary to `_build_start_indices` for proper index computation This enables atomic operations like `atomic_add` to use runtime-computed indices from input data --------- Signed-off-by: Sanket Pandit <sanketp@amd.com> Signed-off-by: Sanket Pandit <sanket.pandit@amd.com>
Add dynamic indexing support for atomic operations in MoE alignment For the MoE align block, we need support for dynamically indexed values in atomic operations. This change introduces `mapping_dynamic_vals` parameter to AtomicOp and updates the atomic operation handler to support dynamic indexing. Key changes: - Add `mapping_dynamic_vals` parameter to atomic operations - Update `handle_atomic_op` decorator to process dynamic values - Convert dynamic registers to index-typed vectors and extract scalar indices - Pass dynamic value dictionary to `_build_start_indices` for proper index computation This enables atomic operations like `atomic_add` to use runtime-computed indices from input data --------- Signed-off-by: Sanket Pandit <sanketp@amd.com> Signed-off-by: Sanket Pandit <sanket.pandit@amd.com>
Add dynamic indexing support for atomic operations in MoE alignment
For the MoE align block, we need support for dynamically indexed values in atomic operations. This change introduces
mapping_dynamic_valsparameter to AtomicOp and updates the atomic operation handler to support dynamic indexing.Key changes:
mapping_dynamic_valsparameter to atomic operationshandle_atomic_opdecorator to process dynamic values_build_start_indicesfor proper index computationThis enables atomic operations like
atomic_addto use runtime-computed indices from input data