Skip to content

[Refactor] Modular Integration Test Framework with DeepSeek-v3 Support #1431

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 26 commits into
base: main
Choose a base branch
from

Conversation

wwwjn
Copy link
Contributor

@wwwjn wwwjn commented Jul 21, 2025

Integration Tests Restructuring

  • Split tests into two sets:

    1. Depth Test: Use llama3 model, to test all the main components of torchtitan are functioning as expected
    2. Breath Test: As we are supporting more models in torchtitan core, setup parallelsim related tests for each model, to test model architecture / args related changes. Make sure the Integration test implementation is easy to extend to new models.
  • Moved integration test files from the root directory to a dedicated tests/integration_tests/ directory

  • Added a base configuration file base_config.toml for integration tests, as most of the train_configs shared 90% same settings

  • Remove "use_for_integration_test" field in train configs. Change to by default using "debugmodel" flavor for integration tests.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 21, 2025
@wwwjn wwwjn changed the title Integration Tests Restructuring for extensible test cases. Modular Integration Test Framework with DeepSeek-v3 Support Jul 21, 2025
@wwwjn wwwjn marked this pull request as draft July 21, 2025 20:15
@wwwjn wwwjn changed the title Modular Integration Test Framework with DeepSeek-v3 Support [WIP] Modular Integration Test Framework with DeepSeek-v3 Support Jul 25, 2025
@wwwjn wwwjn marked this pull request as ready for review July 25, 2025 22:22
@wwwjn wwwjn changed the title [WIP] Modular Integration Test Framework with DeepSeek-v3 Support Modular Integration Test Framework with DeepSeek-v3 Support Jul 25, 2025
Copy link
Contributor

@tianyu-l tianyu-l left a comment

Choose a reason for hiding this comment

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

Great initiative! Left some initial comments, let's discuss.

Comment on lines 681 to 685
parser.add_argument(
"--config_path",
default="./tests/integration_tests/base_config.toml",
help="Base config path for integration tests. This is the config that will be used as a base for all tests.",
)
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to expose this anyway?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I still keep this field for 2 reasons:

  1. We want to leave a little bit flexibility, for developers to quickly run integration tests locally with different config. For example, I could run the features.py with a deepseek debug model config.
  2. A file path is needed since we run intergration tests using command line, and we need to specify CONFIG_FILES={}

@wwwjn wwwjn changed the title Modular Integration Test Framework with DeepSeek-v3 Support [Refactor] Modular Integration Test Framework with DeepSeek-v3 Support Jul 29, 2025
@wwwjn wwwjn force-pushed the ci-refactor branch 2 times, most recently from 7b17cc8 to b8f7a7b Compare July 29, 2025 06:01
Copy link
Contributor

@tianyu-l tianyu-l left a comment

Choose a reason for hiding this comment

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

I suggest we make model tests flat, and reuse functions such as main, run_tests, etc. across all tests -- basically decouple control logic and data.

@@ -4,7 +4,7 @@

#### A PyTorch native platform for training generative AI models

[![integration tests](https://github.com/pytorch/torchtitan/actions/workflows/integration_test_8gpu.yaml/badge.svg?branch=main)](https://github.com/pytorch/torchtitan/actions/workflows/integration_test_8gpu.yaml?query=branch%3Amain)
[![integration tests](https://github.com/pytorch/torchtitan/actions/workflows/integration_test_8gpu_features.yaml/badge.svg?branch=main)](https://github.com/pytorch/torchtitan/actions/workflows/integration_test_8gpu.yaml?query=branch%3Amain)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the badge will show 8 GPU Integration Test - Core Features and I feel it's too verbose.

Also do we want to include two badges?

e.g. 8 GPU Feature Tests and 8 GPU Model Tests



@dataclass
class OverrideDefinitions:
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason we can't reuse this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yes I should. Let me refactor this PR a little bit to reuse the functions

for model_name, test_list in test_case_dict.items():
for test_flavor in test_list:
# Filter by test_name if specified
if args.test_name != "all" and test_flavor.test_name != args.test_name:
Copy link
Contributor

Choose a reason for hiding this comment

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

what if different model_names have the same test_name? Do you run them all?

@@ -601,39 +599,48 @@ def run_test(test_flavor: OverrideDefinitions, full_path: str, output_dir: str):


def run_tests(args):
Copy link
Contributor

Choose a reason for hiding this comment

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

This code is repeatedly defined in every .py tests which I think is very unnecessary.
We only need to have separate .yaml files for GH actions.
We can have different files to host OverrideDefinitions.
But we don't need different files to host the same functions such as main, run_tests, etc.

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.

2 participants