Skip to content
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

Add the examples and the tests in the installed packages. #514

Closed
wants to merge 7 commits into from

Conversation

nouiz
Copy link
Collaborator

@nouiz nouiz commented Nov 10, 2023

This way, we don't need to keep the source directory to run all the tests and examples. This is small.

@nouiz
Copy link
Collaborator Author

nouiz commented Nov 10, 2023

/te-ci

@nouiz nouiz force-pushed the install_example_tests branch from ee90a44 to 0952d76 Compare November 10, 2023 15:56
@yhtang
Copy link

yhtang commented Nov 10, 2023

Note that one issue with this proposed approach is that the examples and tests folders will be directly placed in the Python site-packages folder alongside the transformer_engine engine. As such, it will not be obvious which software these folders belong to.

Maybe, they should be placed inside the transformer_engine folder?

@denera denera force-pushed the install_example_tests branch from 0952d76 to e9a584d Compare November 20, 2023 14:08
nouiz and others added 2 commits November 21, 2023 03:11
…e don't need to keep the source directory to run all the tests and examples. This is small.

Signed-off-by: Frederic Bastien <[email protected]>
…test dir, modified setup.py to install examples and test files

Signed-off-by: Alp Dener <[email protected]>
@denera denera force-pushed the install_example_tests branch from b26c483 to f2e5fa9 Compare November 21, 2023 03:12
@denera
Copy link
Collaborator

denera commented Nov 21, 2023

@nouiz The folder hierarchy should be correct now with the latest commit, but this involves turning examples into an importable submodule. I also migrated the JAX example-based unit tests out of the examples folder into the tests folder in order to avoid contaminating the new examples submodules with unit test classes. The QA scripts reflect this change.

Unit tests are copied over as "package data" so they're not importable. I didn't think it made much sense for them to be submodules.

@denera denera force-pushed the install_example_tests branch from f69336f to a42b53f Compare November 21, 2023 03:34
@denera
Copy link
Collaborator

denera commented Nov 21, 2023

/te-ci jax

Copy link
Collaborator Author

@nouiz nouiz left a comment

Choose a reason for hiding this comment

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

Looks good overall.
@mingxu1067 can you also check?
@yhtang @DwarKapex, can you confirm this will fix the original issue?

#
# See LICENSE for license information.

from . import single_gpu
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For filess that are renamed, grep in TE that they don't appear in the documentation. Maybe you need to update the names there too.

pytest -Wignore -v $TE_PATH/examples/jax/mnist
pytest -Wignore -v $TE_PATH/tests/jax \
--ignore="$TE_PATH/tests/jax/test_encoder.py" \
--ignore-glob="$TE_PATH/tests/jax/test_distributed_*.py"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If you use a * here, use a * in the other test.sh file. Otherwise, there could be mismatch and some tests won't be run.

@@ -608,10 +641,11 @@ def main():
ext_modules.append(setup_paddle_extension())

# Configure package
setuptools.setup(
s = setuptools.setup(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

why?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is unintentionally leftover from debugging. I will remove it shortly alongside other minor fixes.

# See LICENSE for license information.

from . import mnist
from . import encoder
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

nitpik. Many files don't have a new line at the end.

@@ -0,0 +1,41 @@
# Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should you add "example" in the new tests filename?

@denera
Copy link
Collaborator

denera commented Nov 21, 2023

/te-ci jax

@ksivaman
Copy link
Member

This PR is stale as it was created before the build system overhaul and as a result has several conflicts. After a discussion with @nouiz, we will re-open a fresh PR.

@ksivaman ksivaman closed this Jul 26, 2024
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.

4 participants