Skip to content

[Example] Add fused_linear_cross_entropy example and unit test #342

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yf225
Copy link
Contributor

@yf225 yf225 commented Jul 21, 2025

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 21, 2025
"""Fused linear + cross entropy."""
loss, grad_input, grad_weight, grad_bias = fused_linear_cross_entropy_forward(
input_tensor, weight, labels, bias
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other implementation of fused_linear_cross_entropy in tritonbench also include both the Python-level chunking code and the Triton kernel (per-chunk processing) in the benchmark timing measurement. So we do the same here for a fair comparison.

@yf225 yf225 requested a review from jansel July 21, 2025 17:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant