Thank you for considering contributing to the AMD Enterprise AI Workloads development!
-
Fork the repository
-
Clone your fork:
git clone https://github.com/silogen/ai-workloads cd ai-workloads -
Set up development environment:
python -m venv .venv source .venv/bin/activate # install packages you need
We use pre-commit for consistent formatting and cleaner code. Hooks are specified in ai-workloads-dev/.pre-commit-config.yaml.
To install:
cd ai-workloads-dev (this is necessary for pre-commit install, which runs particular to a git repository)
source your_venv
pip install pre-commit
pre-commit install --config .pre-commit-config.yaml
git commit -m "test commit"
With the final command, pre-commit should run automatically, with output something like the following:
check json...........................................(no files to check)Skipped
check yaml...........................................(no files to check)Skipped
fix end of files.....................................(no files to check)Skipped
fix requirements.txt.................................(no files to check)Skipped
trim trailing whitespace.............................(no files to check)Skipped
black................................................(no files to check)Skipped
flake8...............................................(no files to check)Skipped
isort (python).......................................(no files to check)Skipped
mypy.................................................(no files to check)Skipped
helmlint.............................................(no files to check)SkippedIt's also possible to manually run pre-commit using
pre-commit run --all-files
Many pre-commit bugs come from having an incorrect version of pre-commit active. Pre-commit can hang around as a system-wide version, in python venvs, or in your pre-commit cache.
It's easiest to use pre-commit as part of a python virtual environment. To check that the right pre-commit is being found, run which pre-commit and confirm that the binaries inside your venv are shown. For example: /../../venvs/your_venv/bin/pre-commit. A different path could indicate that your system is choosing the wrong pre-commit install.
From system:
brew uninstall pre-commit (mac)
sudo apt remove pre-commit (linux)
From venv:
pip uninstall pre-commit
Just the pre-commit hooks uninstall:
pre-commit uninstall
pre-commit clean
Then reinstall pre-commit from scratch as described above.
-
Create a branch for your feature or bugfix:
git checkout -b feature-name
-
Make your changes and write tests
-
Run tests:
pytest
-
Submit a pull request
Update the documentation when adding new features:
-
Add new pages in the
docs/directory -
Update the
navsection inmkdocs.ymlif necessary -
Test the documentation locally:
mkdocs serve
Follow PEP 8 guidelines. We use black for code formatting and flake8 for linting.