diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000..bdb8407d00 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,42 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: '' + +--- + +**Describe the bug** + +A clear and concise description of what the bug is. + +**Steps/Code to reproduce bug** + +Please list *minimal* steps or code snippet for us to be able to reproduce the bug. + +A helpful guide on on how to craft a minimal bug report http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports. + + +**Expected behavior** + +A clear and concise description of what you expected to happen. + +**Environment overview (please complete the following information)** + + - Environment location: [Bare-metal, Docker, Cloud(specify cloud provider - AWS, Azure, GCP, Collab)] + - Method of install: [pip install or from source]. Please specify exact commands you used to install. + - If method of install is [Docker], provide `docker pull` & `docker run` commands used + +**Environment details** + +If NVIDIA docker image is used you don't need to specify these. +Otherwise, please provide: +- OS version +- PyTorch version +- Python version + +**Additional context** + +Add any other context about the problem here. +Example: GPU model diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000..3a13116134 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,25 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: feature request +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** + +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** + +A clear and concise description of what you want to happen. +Provide a code snippet on how new APIs/changes would be used by others. + +**Describe alternatives you've considered** + +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** + +Add any other context or screenshots about the feature request here \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..22db2a9278 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,25 @@ +# What does this PR do ? + +Add a one line overview of what this PR aims to accomplish. + +# Changelog +- Please update the [CHANGELOG.md](/CHANGELOG.md) under next version with high level changes in this PR. + +# Usage +* You can potentially add a usage example below + +```python +# Add a code snippet demonstrating how to use this +``` + +# Before your PR is "Ready for review" +**Pre checks**: +- [ ] Make sure you read and followed [Contributor guidelines](/CONTRIBUTING.md) +- [ ] Did you write any new necessary tests? +- [ ] Did you add or update any necessary documentation? Make sure to also update the [NeMo Framework User Guide](https://docs.nvidia.com/nemo-framework/user-guide/latest/index.html) which contains the tutorials + +# Checklist when contributing +- [ ] TBD + +# Additional Information +* Related to # (issue) diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 0000000000..dd9bc8c0f4 --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,18 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +documentation: +- docs/** + +CI: +- .github/**/* diff --git a/.github/workflows/_run_test.yml b/.github/workflows/_run_test.yml new file mode 100644 index 0000000000..3a85b30c04 --- /dev/null +++ b/.github/workflows/_run_test.yml @@ -0,0 +1,125 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +name: ~test template + +on: + workflow_call: + inputs: + RUNNER: + type: string + description: Runner to use for test + required: true + TIMEOUT: + type: number + description: Max runtime of test in minutes + required: false + default: 10 + SCRIPT: + type: string + description: Test script to execute + required: true + AFTER_SCRIPT: + type: string + description: Script to run after main test + required: false + default: ":" + IS_OPTIONAL: + type: boolean + description: Failure will cancel all other tests if set to true + required: false + default: false + outputs: + conclusion: + description: Conclusion of main test step + value: ${{ jobs.main.outputs.conclusion }} + log: + description: Last 2000 characters of the test step's log + value: ${{ jobs.main.outputs.log }} +jobs: + + main: + runs-on: ${{ inputs.RUNNER }} + outputs: + conclusion: ${{ steps.main.conclusion }} + log: ${{ steps.main.outputs.log }} + steps: + - name: Docker system cleanup + run: | + docker system prune -a --filter "until=48h" --force || true + + - name: Docker pull image + run: | + docker pull nemoci.azurecr.io/nemo__placeholder_container:${{ github.run_id }} + + - name: Start container + run: | + docker run --rm -d --name nemo_container_${{ github.run_id }} --runtime=nvidia --gpus all --shm-size=64g \ + --env TRANSFORMERS_OFFLINE=0 \ + --env HYDRA_FULL_ERROR=1 \ + --env HF_HOME=/home/TestData/_placeholder/hf_home \ + --env _PLACEHOLDER_CI_DIR=/home/TestData/_placeholder \ + --env _PLACEHOLDER_REPO_DIR=/opt/NeMo-_Placeholder \ + --volume /mnt/datadrive/TestData/_placeholder/checkpoints:/home/TestData/_placeholder/checkpoints:ro \ + --volume /mnt/datadrive/TestData/_placeholder/hf_home/hub:/home/TestData/_placeholder/hf_home/hub:ro \ + nemoci.azurecr.io/nemo__placeholder_container:${{ github.run_id }} \ + bash -c "sleep $(( ${{ inputs.TIMEOUT }} * 60 + 60 ))" + + - id: main + name: Run main script + timeout-minutes: ${{ inputs.TIMEOUT }} + run: | + # Print the host driver for debugging + nvidia-smi + mkdir -p ${{ github.run_id }} + cd ${{ github.run_id }}/ + + set +e + ( + set -e + + cmd=$(cat <<"RUN_TEST_EOF" + nvidia-smi + # Sanity check the driver/cuda combo + cudaCheck + # In case git commands need to be run inside _Placeholder + git config --global --add safe.directory $_PLACHOLDER_REPO_DIR + ${{ inputs.SCRIPT }} + RUN_TEST_EOF + ) + docker exec nemo_container_${{ github.run_id }} bash -eux -o pipefail -c "$cmd" + ) 2> >(tee err.log) + + EXIT_CODE=$? + + echo "log=$(tail -c 2000 err.log | base64 -w 0)" >> "$GITHUB_OUTPUT" + + exit $EXIT_CODE + + - uses: "NVIDIA/NeMo/.github/actions/cancel-workflow@main" + if: failure() && inputs.IS_OPTIONAL == false + + - name: after_script + if: always() && inputs.AFTER_SCRIPT != ':' + run: | + cmd=$(cat <<"RUN_TEST_EOF" + ${{ inputs.AFTER_SCRIPT }} + RUN_TEST_EOF + ) + docker exec nemo_container_${{ github.run_id }} bash -eux -o pipefail -c "$cmd" + + - name: Container shutdown + if: always() + run: | + docker container stop nemo_container_${{ github.run_id }} || true + docker container rm nemo_container_${{ github.run_id }} || true diff --git a/.github/workflows/build-test-publish-wheel.yml b/.github/workflows/build-test-publish-wheel.yml new file mode 100644 index 0000000000..1b6c5a3021 --- /dev/null +++ b/.github/workflows/build-test-publish-wheel.yml @@ -0,0 +1,37 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# name: Build, test, and publish a PyPi wheel (to testpypi) + +# on: +# push: +# branches: +# - main +# - 'r**' + +# defaults: +# run: +# shell: bash -x -e -u -o pipefail {0} + +# jobs: +# build-test-publish-wheel: +# uses: NVIDIA/NeMo-FW-CI-templates/.github/workflows/_build_test_publish_wheel.yml@v0.22.3 +# with: +# dry-run: true +# python-package: nemo__placeholder +# python-version: "3.12" +# secrets: +# TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} +# TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} +# SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_ENDPOINT }} +# SLACK_WEBHOOK_ADMIN: ${{ secrets.SLACK_WEBHOOK_ADMIN }} diff --git a/.github/workflows/cherry-pick-release-commit.yml b/.github/workflows/cherry-pick-release-commit.yml new file mode 100644 index 0000000000..18ba7764c2 --- /dev/null +++ b/.github/workflows/cherry-pick-release-commit.yml @@ -0,0 +1,27 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +name: Create PR to main with cherry-pick from release + +on: + push: + branches: + - main + +jobs: + cherry-pick: + uses: NVIDIA/NeMo-FW-CI-templates/.github/workflows/_cherry_pick.yml@v0.22.7 + secrets: + PAT: ${{ secrets.PAT }} + SLACK_WEBHOOK_ADMIN: ${{ secrets.SLACK_WEBHOOK_ADMIN }} + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} diff --git a/.github/workflows/cicd-main.yml b/.github/workflows/cicd-main.yml new file mode 100644 index 0000000000..627544fc81 --- /dev/null +++ b/.github/workflows/cicd-main.yml @@ -0,0 +1,123 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +name: "CICD NeMo _Placeholder" + +on: + pull_request: + branches: + - 'main' + - 'r**' + types: [labeled] + merge_group: + types: [checks_requested] + workflow_dispatch: + inputs: + test_to_run: + required: false + default: all + type: string + description: Comma-separated list of tests to run. Use "all" to run the full test suite. + push: + branches: + - 'main' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.event.label.name || 'main' }} + cancel-in-progress: true + +jobs: + pre-flight: + runs-on: ubuntu-latest + outputs: + test_to_run: ${{ steps.test_to_run.outputs.main }} + all: ${{ steps.all.outputs.main }} + run_ci: ${{ steps.evaluate.outputs.run_ci }} + steps: + - name: Parse test_to_run + id: test_to_run + run: | + parsed_string=$(echo ${{ inputs.test_to_run || 'all' }} | jq -c --raw-input 'split(",")') + echo "main=${parsed_string}" | tee -a "$GITHUB_OUTPUT" + - name: Parse all + id: all + run: | + echo "main=${{ contains(fromJSON(steps.test_to_run.outputs.main), 'all') }}" | tee -a "$GITHUB_OUTPUT" + + - name: Get changed files + id: changed-files + if: github.event_name == 'pull_request' + uses: step-security/changed-files@v45.0.1 + with: + files_yaml: | + doc: + - '**.md' + - docs/** + src: + - '!**.md' + - '!docs/**' + + - name: Evaluate conditions + id: evaluate + env: + DOCS_ONLY: ${{ steps.changed-files.outputs.doc_any_changed == 'true' && steps.changed-files.outputs.src_any_changed == 'false' }} + CHANGED_DOCS: ${{ steps.changed-files.outputs.doc_all_changed_files }} + CHANGED_SRC: ${{ steps.changed-files.outputs.src_all_changed_files }} + IS_PULLREQUEST: ${{ github.event_name == 'pull_request' }} + LABEL: ${{ github.event.label.name == 'Run CICD' }} + MERGE_GROUP: ${{ github.event_name == 'merge_group' }} + run: | + # Some output that's helpful for debugging + echo "Docs changed: $CHANGED_DOCS" + echo "Src changed: $CHANGED_SRC" + + # echo "DOCS_ONLY: $DOCS_ONLY" + echo "LABEL: $LABEL" + echo "IS_PULLREQUEST: $IS_PULLREQUEST" + + # Run CI only (on main or if label is attached) and if it's not only docs + echo run_ci=$([[ ("$LABEL" = "true" || "$IS_PULLREQUEST" = "false" || "$MERGE_GROUP" = "true") && "$DOCS_ONLY" = "false" ]] && echo "true" || echo "false") | tee -a "$GITHUB_OUTPUT" + + lint-check: + name: Lint check + needs: [pre-flight] + runs-on: ubuntu-latest + if: ${{ needs.pre-flight.outputs.run_ci == 'true' }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Check lint + run: | + pip install pre-commit + pre-commit install + pre-commit run --all-files --show-diff-on-failure --color=always + + unit-tests: + name: Unit tests + needs: [pre-flight] + runs-on: ubuntu-latest + if: ${{ needs.pre-flight.outputs.run_ci == 'true' }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Run unit tests + run: | + pip install uv + uv venv -p python3.10 .venv + uv pip install --force-reinstall . + uv run --group test -- pytest + + - name: after_script + if: always() + run: | + rm -rf .venv diff --git a/.github/workflows/copyright-check.yml b/.github/workflows/copyright-check.yml new file mode 100644 index 0000000000..3e6dba0b53 --- /dev/null +++ b/.github/workflows/copyright-check.yml @@ -0,0 +1,21 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +name: Copyright check + +on: + pull_request: + +jobs: + copyright-check: + uses: NVIDIA/NeMo-FW-CI-templates/.github/workflows/_copyright_check.yml@v0.2.0 diff --git a/.github/workflows/labeler.yaml b/.github/workflows/labeler.yaml new file mode 100644 index 0000000000..c98d2a8c56 --- /dev/null +++ b/.github/workflows/labeler.yaml @@ -0,0 +1,27 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +name: "Pull Request Labeler" +on: +- pull_request_target + +jobs: + triage: + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: actions/labeler@v4 + with: + repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/release-freeze.yml b/.github/workflows/release-freeze.yml new file mode 100644 index 0000000000..176b6681e0 --- /dev/null +++ b/.github/workflows/release-freeze.yml @@ -0,0 +1,46 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +name: "Code freeze" + +on: + workflow_dispatch: + inputs: + release-type: + type: choice + description: Type of release + options: + - major + - minor + freeze-commit: + type: string + description: Commit SHA to use for cut-off + required: false + default: main + dry-run: + type: boolean + description: Dry-run of code-freeze + required: false + default: true +jobs: + code-freeze: + uses: NVIDIA/NeMo-FW-CI-templates/.github/workflows/_code_freeze.yml@v0.22.5 + with: + library-name: NeMo-_Placeholder + python-package: nemo__placeholder + release-type: ${{ inputs.release-type }} + freeze-commit: ${{ inputs.freeze-commit }} + dry-run: ${{ inputs.dry-run }} + secrets: + SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_ENDPOINT }} + SLACK_WEBHOOK_ADMIN: ${{ secrets.SLACK_WEBHOOK_ADMIN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000000..247e821beb --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,48 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +name: "Release _Placeholder" + +on: + workflow_dispatch: + inputs: + release-ref: + description: Ref (SHA or branch name) to release + required: true + type: string + dry-run: + description: Do not publish a wheel and GitHub release. + required: true + default: true + type: boolean + version-bump-branch: + description: Branch for version bump + required: true + type: string + +jobs: + release: + uses: NVIDIA/NeMo-FW-CI-templates/.github/workflows/_release_library.yml@v0.22.6 + with: + release-ref: ${{ inputs.release-ref }} + python-package: nemo__placeholder + python-version: "3.11" + library-name: NeMo-_Placeholder + dry-run: ${{ inputs.dry-run }} + version-bump-branch: ${{ inputs.version-bump-branch }} + secrets: + TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }} + TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} + SLACK_WEBHOOK_ADMIN: ${{ secrets.SLACK_WEBHOOK_ADMIN }} + SLACK_WEBHOOK: ${{ secrets.SLACK_RELEASE_ENDPOINT }} + PAT: ${{ secrets.PAT }} diff --git a/.github/workflows/semantic-pull-request.yml b/.github/workflows/semantic-pull-request.yml new file mode 100644 index 0000000000..7ef7972c0e --- /dev/null +++ b/.github/workflows/semantic-pull-request.yml @@ -0,0 +1,40 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +name: Validate PR title + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + - reopened + pull_request: + types: + - opened + - edited + - synchronize + - reopened + +defaults: + run: + shell: bash -x -e -u -o pipefail {0} + +permissions: + pull-requests: read + +jobs: + semantic-pull-request: + uses: NVIDIA/NeMo-FW-CI-templates/.github/workflows/_semantic_pull_request.yml@v0.13.0 + \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..2628699139 --- /dev/null +++ b/.gitignore @@ -0,0 +1,156 @@ +# log and data files +*.model +*.pkl +*.pt +.DS_Store +.hydra +.bash_history.local + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class +**.pyc + +# C extensions +*.so + +# Distribution / packaging +.idea +.Python +wandb +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +#parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/build + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# Override Jupyter in Github Language states for more accurate estimate of repo code. +# Reference: https://github.com/github/linguist/blob/master/docs/overrides.md#generated-code +*.ipynb linguist-generated + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don’t work, or not +# install all needed dependencies. +#Pipfile.lock + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +venv/ +env.bak/ +venv.bak/ + +# VSCode project settins +.vscode/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site +/docs/html +/docs/docs_zh/zh + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# Emacs backup files +*~ + +*.tar.gz + +# Test data. +tests/.data +tests/data + +# outputs folder +wandb + +# Checkpoints, config files and temporary files created in tutorials. +.hydra/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..8fe30b1e26 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,17 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: end-of-file-fixer + # only include python files + files: \.py$ + - id: trailing-whitespace + # only include python files + files: \.py$ + + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: "v0.9.9" # Use the appropriate version + hooks: + - id: ruff + args: ["--fix"] + - id: ruff-format diff --git a/README.md b/README.md index fdffa2a0fd..7ce63a5cf4 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# placeholder +# _placeholder diff --git a/nemo__placeholder/__init__.py b/nemo__placeholder/__init__.py new file mode 100644 index 0000000000..f5e16b0d09 --- /dev/null +++ b/nemo__placeholder/__init__.py @@ -0,0 +1,13 @@ +from nemo__placeholder.package_info import ( + __contact_emails__, + __contact_names__, + __description__, + __download_url__, + __homepage__, + __keywords__, + __license__, + __package_name__, + __repository_url__, + __shortversion__, + __version__, +) diff --git a/nemo__placeholder/package_info.py b/nemo__placeholder/package_info.py new file mode 100644 index 0000000000..e1daf52f75 --- /dev/null +++ b/nemo__placeholder/package_info.py @@ -0,0 +1,35 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +MAJOR = 0 +MINOR = 1 +PATCH = 0 +PRE_RELEASE = "" + +# Use the following formatting: (major, minor, patch, pre-release) +VERSION = (MAJOR, MINOR, PATCH, PRE_RELEASE) + +__shortversion__ = ".".join(map(str, VERSION[:3])) +__version__ = ".".join(map(str, VERSION[:3])) + "".join(VERSION[3:]) + +__package_name__ = "nemo__placeholder" +__contact_names__ = "NVIDIA" +__contact_emails__ = "nemo-_placeholder@nvidia.com" +__homepage__ = "https://docs.nvidia.com/deeplearning/nemo/user-guide/docs/en/stable/" +__repository_url__ = "https://github.com/nvidia/nemo__placeholder" +__download_url__ = "https://github.com/NVIDIA/NeMo__placeholder" +__description__ = "_placeholder" +__license__ = "Apache2" +__keywords__ = "_placeholder" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000000..8793fb50ed --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,79 @@ +[build-system] +requires = ["setuptools>=42", "wheel", "torch==2.6.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "nemo-_placeholder" +version = "0.0.1" +description = "_Placeholder" +readme = "README.md" +requires-python = ">=3.10" +license = {text = "Apache 2.0"} +dependencies = [ + "torch==2.6.0" +] + +[tool.setuptools] +packages = ["nemo__placeholder"] + +[dependency-groups] +dev = [ + "pre-commit==3.6.0", + "ruff==0.9.9", +] +test = [ + "pytest>=7.0.0", + "pytest-timeout", + "pytest-cov", +] + +[project.optional-dependencies] +build = [ + "torch==2.6.0", + "setuptools", + "packaging", + "einops" +] +docs = [ + "sphinx", + "sphinx-autobuild", # For live doc serving while editing docs + "sphinx-autodoc2", # For documenting Python API + "sphinx-copybutton", # Adds a copy button for code blocks + "myst_parser", # For our markdown docs + "nvidia-sphinx-theme", # Our NVIDIA theme +] + +[tool.black] +line-length = 120 +include = '\.pyi?$' +exclude = ''' +/( + \.git + | \.venv + | build +)/ +''' + +[tool.pytest.ini_options] +testpaths = ["tests"] +python_files = "test_*.py" + +[tool.ruff.lint] +# Enable all `pydocstyle` rules, limiting to those that adhere to the +# Google convention via `convention = "google"`, below. +select = ["D"] + +# On top of the Google convention, disable `D417`, which requires +# documentation for every function parameter. +# TODO: Remove D10 once we are about to release to get all the docstrings written +ignore = ["D417", "D10"] + +[tool.ruff.lint.pydocstyle] +convention = "google" + +# Section to exclude errors for different file types +[tool.ruff.per-file-ignores] +# Ignore all directories named `tests`. +"tests/**" = ["D"] +# Ignore all files that end in `_test.py`. +"*_test.py" = ["D"] diff --git a/tests/unit/test__placeholder.py b/tests/unit/test__placeholder.py new file mode 100644 index 0000000000..0ae23d24f7 --- /dev/null +++ b/tests/unit/test__placeholder.py @@ -0,0 +1,18 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +def test__placeholder(): + """Should be True""" + assert True is True