Skip to content
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

Change embedding backward op output data format setup #1142

Closed
pmarkovicTT opened this issue Jan 30, 2025 · 0 comments · Fixed by #1143
Closed

Change embedding backward op output data format setup #1142

pmarkovicTT opened this issue Jan 30, 2025 · 0 comments · Fixed by #1143
Assignees
Labels
bug Something isn't working

Comments

@pmarkovicTT
Copy link
Contributor

The current logic for setting up output data format for backward ops selects data format of the first input operand.
Reference: void OpNode::set_output_df_from_operands(const Graph *graph) in the node_types.cpp.

This is problematic since different ops can require output to match data format of some other input operand. For instance, the embedding backward op should match data format of embedding weights (the second operand).

@pmarkovicTT pmarkovicTT added the bug Something isn't working label Jan 30, 2025
@pmarkovicTT pmarkovicTT added this to the [Training] Llama bwd pass milestone Jan 30, 2025
@pmarkovicTT pmarkovicTT self-assigned this Jan 30, 2025
@pmarkovicTT pmarkovicTT changed the title Change backward op output data format setup Change embedding backward op output data format setup Feb 3, 2025
vwellsTT pushed a commit that referenced this issue Feb 4, 2025
### Ticket
Close #1142

### Problem description
The current logic for setting up output data format for backward ops
selects data format of the first input operand.
Reference: `void OpNode::set_output_df_from_operands(const Graph
*graph)` in the `node_types.cpp`.

This is problematic since different ops can require output to match data
format of some other input operand. For instance, the embedding backward
op should match data format of embedding weights (the second operand).

### What's changed
Changed the way embedding backward op is created (explicitly setting up
output data format through autogradContext).

### Checklist
- [x] Add set_output_df method to autogradContext
- [x] Updated backward method for embedding op (`embedding.py`)
- [x] Test new logic (test_llama_backward) - note here, couldn't find
explicit tests for adding new functions so test with existing one.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant