Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.

feat: introducing the experimental package and refactoring test structure#433

Merged
terrykong merged 12 commits intomainfrom
tk/experimental
Jan 22, 2025
Merged

feat: introducing the experimental package and refactoring test structure#433
terrykong merged 12 commits intomainfrom
tk/experimental

Conversation

@terrykong
Copy link
Copy Markdown
Collaborator

@terrykong terrykong commented Dec 6, 2024

What does this PR do ?

Introduces experimental directory structure for code and docs. As part of the restructuring, the tests are moved closer to the source to reduce the repetition of directory structure.

Before

NeMo-Aligner/
├── docs/
│   └── user-guide/
│       └── ppo.html
├── nemo_aligner/
│   ├── algorithms/
│   └── data/
│       └── datasets.py
└── tests/
    ├── test_datasets.py
    └── functional/
        └── test_cases/
            └── dpo-llama3

Proposal

NeMo-Aligner/
├── docs/
│   ├── user-guide/
│   │   └── ppo.html
│   └── user-guide-experimental/    <----- experimental docs
│       └── new-thing.html
├── nemo_aligner/
│   ├── algorithms/
│   ├── data/
│   │   ├── datasets.py
│   │   └── tests/
│   │       └── datasets_test.py
│   └── experimental/               <----- experimental sub-package
│       ├── <proj-name>/
│           ├── dataset.py          <----- experimental dataset
│           ├── new_algo.py         <----- experimental algo
│           ├── model.py            <----- experimental model
│           └── tests/
│               └── model_test.py   <----- experimental model test
└── tests/
    └── functional/
        └── dpo.sh
        └── test_cases/
            └── dpo-llama3
    └── functional_experimental/    <----- experimental functional tests (mirrors functional/ structure)
        ├── new_algo.sh
        └── test_cases/
            └── new_algo-llama3
  • By moving the docs out of the main dir, we can control what is rendered in the NeMo docs
  • colocating the tests in the same package makes it easier to find tests and reduces number of mirrored dirs
    • these can be filtered out when we publish to pypi (Needs more investigation)
  • functional tests will stay outside for convenience

@github-actions github-actions Bot added the CI label Dec 6, 2024
@github-actions github-actions Bot added Utils documentation Improvements or additions to documentation labels Jan 13, 2025
@terrykong terrykong added the Run CICD Set + un-set to retrigger (add after r*.*.* labels) label Jan 13, 2025
@terrykong terrykong changed the title Tk/experimental feat: introducing the experimental package and refactoring test structure Jan 14, 2025
@terrykong terrykong changed the title feat: introducing the experimental package and refactoring test structure feat: introducing the experimental package and refactoring test structure Jan 14, 2025
@github-actions github-actions Bot removed the CI label Jan 14, 2025
@terrykong terrykong marked this pull request as ready for review January 14, 2025 07:42
@terrykong terrykong added Run CICD Set + un-set to retrigger (add after r*.*.* labels) and removed Run CICD Set + un-set to retrigger (add after r*.*.* labels) labels Jan 14, 2025
@terrykong
Copy link
Copy Markdown
Collaborator Author

@ko3n1g Tried excluding the test files via Manifest.in/exclude_package_data, but both don't seem to work when building a sdist wheel or simply pip install .

@terrykong terrykong added Run CICD Set + un-set to retrigger (add after r*.*.* labels) and removed Run CICD Set + un-set to retrigger (add after r*.*.* labels) labels Jan 16, 2025
@terrykong terrykong removed the request for review from gshennvm January 17, 2025 00:06
Copy link
Copy Markdown
Collaborator

@odelalleau odelalleau left a comment

Choose a reason for hiding this comment

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

Looks mostly good to me, just a few questions below, and one suggestion: I think it'd be better to have tests of experimental features under a dedicated folder, so that we can easily identify them. Either under tests/functional/experimental, or tests/experimental, or tests/functional_experimental for instance.

Comment thread Dockerfile
Comment thread nemo_aligner/experimental/README.md Outdated
Comment thread nemo_aligner/experimental/README.md
Comment thread nemo_aligner/utils/test_utils.py
Comment thread conftest.py
@terrykong
Copy link
Copy Markdown
Collaborator Author

terrykong commented Jan 21, 2025

I think it'd be better to have tests of experimental features under a dedicated folder, so that we can easily identify them. Either under tests/functional/experimental, or tests/experimental, or tests/functional_experimental for instance

@odelalleau Makes sense! Please see 2893053

@terrykong terrykong added Run CICD Set + un-set to retrigger (add after r*.*.* labels) and removed Run CICD Set + un-set to retrigger (add after r*.*.* labels) labels Jan 21, 2025
odelalleau
odelalleau previously approved these changes Jan 21, 2025
Copy link
Copy Markdown
Collaborator

@odelalleau odelalleau left a comment

Choose a reason for hiding this comment

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

@odelalleau Makes sense! Please see 2893053

Looking good, thanks!

terrykong and others added 12 commits January 21, 2025 19:12
Signed-off-by: Terry Kong <terryk@nvidia.com>
Signed-off-by: Terry Kong <terryk@nvidia.com>
Signed-off-by: Terry Kong <terryk@nvidia.com>
Signed-off-by: Terry Kong <terryk@nvidia.com>
Signed-off-by: Terry Kong <terryk@nvidia.com>
for more information, see https://pre-commit.ci

Signed-off-by: NeMo-Aligner CI <nemo-aligner-ci@nvidia.com>
Signed-off-by: Terry Kong <terryk@nvidia.com>
Signed-off-by: Terry Kong <terryk@nvidia.com>
Signed-off-by: Terry Kong <terryk@nvidia.com>
Signed-off-by: Terry Kong <terryk@nvidia.com>
Signed-off-by: Terry Kong <terryk@nvidia.com>
Signed-off-by: Terry Kong <terryk@nvidia.com>
@terrykong terrykong added Run CICD Set + un-set to retrigger (add after r*.*.* labels) and removed Run CICD Set + un-set to retrigger (add after r*.*.* labels) labels Jan 21, 2025
@terrykong terrykong enabled auto-merge (squash) January 21, 2025 19:13
Copy link
Copy Markdown
Collaborator

@ko3n1g ko3n1g left a comment

Choose a reason for hiding this comment

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

great change, thanks!

@terrykong terrykong merged commit 502ebde into main Jan 22, 2025
@terrykong terrykong deleted the tk/experimental branch January 22, 2025 21:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

documentation Improvements or additions to documentation Run CICD Set + un-set to retrigger (add after r*.*.* labels)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants