transformers
Sum the MoE experts' top-k outputs without a float32 copy of all rows
#51491
Merged

Sum the MoE experts' top-k outputs without a float32 copy of all rows #51491

eilamc14
eilamc14 Sum the MoE experts' top-k outputs without a float32 copy of all rows
258c13d2
eilamc14 Leave the expert-parallel sentinel comment as it was
b5da6744
IlyasMoutawwakil
IlyasMoutawwakil commented on 2026-11-30
IlyasMoutawwakil
IlyasMoutawwakil commented on 2026-11-30
eilamc14 Cast each chunk's sum to the rows' dtype, and use one expression when…
c57d8c2a
eilamc14 Restore the experts order with index_copy_ when gradients are needed
d4ef7eaf
eilamc14 eilamc14 force pushed from 0980c33d to d4ef7eaf 2 days ago
eilamc14
eilamc14 eilamc14 marked this pull request as ready for review 2 days ago
HuggingFaceDocBuilderDev
IlyasMoutawwakil IlyasMoutawwakil requested a review from vasqu vasqu 1 day ago
vasqu
vasqu approved these changes on 2026-12-01
eilamc14
eilamc14 Move the reshape+sum explanation into _weighted_sum's docstring
1f8565d5
IlyasMoutawwakil
eilamc14 Chunk the weighted sum only when gradients are needed
183d81dd
eilamc14
IlyasMoutawwakil
IlyasMoutawwakil commented on 2026-12-01
eilamc14 Check compiling and no-grad before computing the chunk size
d217c8a8
IlyasMoutawwakil Weighted sum: is_torchdynamo_compiling and a grad-enabled training ch…
d48bab87
IlyasMoutawwakil Move the unsort into _unsort, inline the single-use training check
4fd5c66d
IlyasMoutawwakil _unsort: index_copy_ when compiling too, keep the single-chunk path o…
18e4b87e
IlyasMoutawwakil
IlyasMoutawwakil
IlyasMoutawwakil approved these changes on 2026-12-01
eilamc14
IlyasMoutawwakil IlyasMoutawwakil merged 626e62ef into main 19 hours ago
eilamc14 eilamc14 deleted the moe-combine-rows-dtype branch 19 hours ago

Login to write a write a comment.

Login via GitHub

Assignees
No one assigned
Labels
Milestone