Skip to content

[feat] [AutoDeploy] Llama-4 Support #4163

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

Closed
wants to merge 7 commits into from

Conversation

lucaslie
Copy link
Member

@lucaslie lucaslie commented May 8, 2025

Description

  • Updated/New Factory to differentiate between the different AutoModel APIs in HF
  • Adding support for Llama-4 Scout
  • Llama-4 Maverick Support
  • Updated Readme
  • Updated unit+integration tests

GitHub Bot Help

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

run [--disable-fail-fast --skip-test --stage-list "A10-1, xxx" --gpu-type "A30, H100_PCIe" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-[Post-Merge]-1, xxx"]

Launch build/test pipelines. All previously running jobs will be killed.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-1, xxx" (OPTIONAL) : Only run the specified test stages. Examples: "A10-1, xxx". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests. Will also run L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-[Post-Merge]-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Examples: --extra-stage "H100_PCIe-[Post-Merge]-1, xxx".

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

reuse-pipeline

Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

@lucaslie lucaslie self-assigned this May 8, 2025
@lucaslie lucaslie requested a review from Copilot May 8, 2025 18:41
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for Llama-4 within AutoDeploy by introducing a new BMM sharding transformation, updating model factory configurations, and refining related logging and flashinfer attention buffer sizes. Key changes include:

  • Introducing the bmm_shard transformation and its associated unit tests.
  • Updating logging levels in node_utils and modifying model factory values in several modules.
  • Adjusting input processing in the demo interface and updating configuration defaults for examples.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/unittest/_torch/auto_deploy/unit/multigpu/transformations/library/test_bmm_sharding.py New unit tests for the BMM sharding transformation.
tensorrt_llm/_torch/auto_deploy/utils/node_utils.py Downgraded logging of residual node warnings from warning to debug.
tensorrt_llm/_torch/auto_deploy/transformations/transform.py Added call to bmm_shard as part of the transformation pipeline.
tensorrt_llm/_torch/auto_deploy/transformations/library/sharding.py Introduced the bmm_shard function for sharding batched matrix multiplications.
tensorrt_llm/_torch/auto_deploy/shim/interface.py Updated default model_factory parameter for AutoDeployConfig.
tensorrt_llm/_torch/auto_deploy/shim/demollm.py Changed call to create_input_processor to pass None instead of model.
tensorrt_llm/_torch/auto_deploy/models/hf.py Modified factory registration and heuristics for disabling use_cache.
tensorrt_llm/_torch/auto_deploy/custom_ops/flashinfer_attention.py Increased workspace buffer allocation from 128MB to 320MB with updated notes.
examples/auto_deploy/simple_config.py, .vscode/settings.json, .vscode/launch.json Updated configuration defaults and VSCode settings for the new changes.
Comments suppressed due to low confidence (3)

tests/unittest/_torch/auto_deploy/unit/multigpu/transformations/library/test_bmm_sharding.py:68

  • Consider adding tests for the scenario where the BMM batch size is not evenly divisible by world_size to ensure the transformation correctly handles uneven distributions.
run_test(

tensorrt_llm/_torch/auto_deploy/utils/node_utils.py:297

  • [nitpick] Verify that downgrading the log level from warning to debug does not mask potentially critical issues when residual nodes have more than two users.
ad_logger.debug(f"Unexpected # of users for residuals: {res_nodes_more_users}")

tensorrt_llm/_torch/auto_deploy/shim/demollm.py:375

  • [nitpick] Confirm that 'create_input_processor' gracefully handles a None value for the model parameter; if not, consider adding explicit handling or documentation for this case.
self.input_processor = create_input_processor(None, self.tokenizer)


assert isinstance(gm, GraphModule), "Expecting GraphModule"

def handle_tensor(
Copy link
Member Author

Choose a reason for hiding this comment

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

@meenchen, here is an example of bmm sharding where either tensor can be a weight or activation tensor

@lucaslie
Copy link
Member Author

TODO: only claim torch-compile in the support matrix, not torch-opt

@lucaslie
Copy link
Member Author

/bot run --disable-fail-fast --extra-stage "DGX_H100-4_GPUs-PyTorch-[Post-Merge]"

@tensorrt-cicd
Copy link
Collaborator

PR_Github #5199 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #5199 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #3795 completed with status: 'FAILURE'

@lucaslie
Copy link
Member Author

/bot run --disable-fail-fast --extra-stage "DGX_H100-4_GPUs-PyTorch-[Post-Merge]"

@tensorrt-cicd
Copy link
Collaborator

PR_Github #5242 [ run ] triggered by Bot

@tensorrt-cicd
Copy link
Collaborator

PR_Github #5242 [ run ] completed with state SUCCESS
/LLM/main/L0_MergeRequest_PR pipeline #3831 completed with status: 'FAILURE'

lucaslie added 6 commits May 15, 2025 15:24
Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
Signed-off-by: Lucas Liebenwein <11156568+lucaslie@users.noreply.github.com>
@lucaslie
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants