Skip to content

Fix LLaMA3 training resolve device string maca error - #268

Merged
MC952-arch merged 1 commit into
flagos-ai:mainfrom
whollo:Fix-llama3-train-debug
Oct 15, 2025
Merged

Fix LLaMA3 training resolve device string maca error#268
MC952-arch merged 1 commit into
flagos-ai:mainfrom
whollo:Fix-llama3-train-debug

Conversation

@whollo

@whollo whollo commented Oct 13, 2025

Copy link
Copy Markdown
Contributor

Fix: resolve maca device string error during LLaMA3 training

@gemini-code-assist

Copy link
Copy Markdown

Summary of Changes

Hello @whollo, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses a critical issue that was preventing LLaMA3 training by fixing an incorrect device string assignment within the flagcxBackend implementation. The change ensures that when the USE_METAX_ADAPTOR is used, the system correctly identifies the device as "cuda" instead of "maca", thus resolving device recognition errors. Additionally, a minor formatting inconsistency was resolved by adding a newline at the end of the file.

Highlights

  • Device String Correction: Corrected the device string from "maca" to "cuda" when the USE_METAX_ADAPTOR preprocessor directive is active. This resolves an error encountered during LLaMA3 training.
  • File Formatting: Added a missing newline character at the end of the backend_flagcx.hpp file.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request addresses an error during LLaMA3 training on MetaX (maca) devices by correcting the device string reported to PyTorch. The change from "maca" to "cuda" aligns with how PyTorch recognizes CUDA-compatible devices, resolving the issue. The fix is appropriate. I have added one suggestion to include a comment explaining this mapping for better code maintainability.

Comment thread plugin/torch/flagcx/include/backend_flagcx.hpp

@MC952-arch MC952-arch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@yuejiewang yuejiewang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@MC952-arch
MC952-arch merged commit 11dc7e4 into flagos-ai:main Oct 15, 2025
3 of 4 checks passed
liuhe-spec pushed a commit to liuhe-spec/FlagCX that referenced this pull request Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants