Skip to content

Add cross_entropy example and unit test #320

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

Merged
merged 1 commit into from
Jul 15, 2025
Merged

Add cross_entropy example and unit test #320

merged 1 commit into from
Jul 15, 2025

Conversation

yf225
Copy link
Contributor

@yf225 yf225 commented Jul 14, 2025

stack-info: PR: #320, branch: yf225/stack/28
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 14, 2025
@yf225 yf225 requested a review from jansel July 14, 2025 20:08
@yf225 yf225 changed the base branch from yf225/stack/27 to main July 14, 2025 20:09
@yf225 yf225 changed the base branch from main to yf225/stack/27 July 14, 2025 20:09
Copy link
Contributor

@jansel jansel left a comment

Choose a reason for hiding this comment

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

Could we call the pytorch function for cross entropy (that will get decomposed) here to use less code?

# TritonBench configuration - adjust based on available GPU memory
if get_gpu_memory_info()[0] < 16.0:
# Low memory configuration for GPUs with less than 16GB
TRITONBENCH_ARGS = {"B": 4, "T": 512, "v_range": "10,15"}
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It’s for development on low-VRAM machines - switched to use HELION_DEV_LOW_VRAM to gate this

@yf225 yf225 changed the base branch from yf225/stack/27 to main July 15, 2025 07:12
@yf225 yf225 force-pushed the yf225/stack/28 branch 2 times, most recently from 28a5978 to 0bbe404 Compare July 15, 2025 07:12
@yf225 yf225 changed the base branch from main to yf225/stack/32 July 15, 2025 07:12
@yf225 yf225 changed the base branch from yf225/stack/32 to main July 15, 2025 07:13
@yf225 yf225 changed the base branch from main to yf225/stack/31 July 15, 2025 07:13
@yf225 yf225 changed the base branch from yf225/stack/31 to main July 15, 2025 07:18
@yf225 yf225 changed the base branch from main to yf225/stack/31 July 15, 2025 07:19
@yf225 yf225 changed the base branch from yf225/stack/31 to main July 15, 2025 07:20
@yf225 yf225 changed the base branch from main to yf225/stack/31 July 15, 2025 07:21
@yf225
Copy link
Contributor Author

yf225 commented Jul 15, 2025

Could we call the pytorch function for cross entropy (that will get decomposed) here to use less code?

@jansel I tried to just use the pytorch F.cross_entropy function within Helion tile loop but ran into some lowering issues. I will do another sweep later to test lowering for all common F functions and fix the issues.

@yf225 yf225 requested a review from jansel July 15, 2025 07:27
@yf225 yf225 changed the base branch from yf225/stack/31 to main July 15, 2025 19:33
@yf225 yf225 merged commit deb7c8a into main Jul 15, 2025
7 checks passed
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.

3 participants