-
Notifications
You must be signed in to change notification settings - Fork 0
Add production infrastructure: documentation, testing, CI/CD, and examples #1
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
Merged
MathewYoussef
merged 4 commits into
main
from
copilot/improve-documentation-and-testing
Jan 24, 2026
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
58dc09d
Initial plan
Copilot b786f32
Add documentation, tests, and code quality improvements
Copilot c1b4eb0
Add examples, additional tests, and enhanced documentation
Copilot 7d98c11
Add setup verification script and update installation guide
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| name: Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| pull_request: | ||
| branches: [ main, develop ] | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| python-version: ['3.8', '3.9', '3.10', '3.11'] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install pytest pytest-cov pyyaml numpy matplotlib | ||
| # Install CPU-only PyTorch for CI (no GPU required for basic tests) | ||
| pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu | ||
|
|
||
| - name: Run config tests | ||
| run: | | ||
| pytest tests/test_config.py -v | ||
|
|
||
| - name: Run mask tests (CPU only) | ||
| run: | | ||
| pytest tests/test_masks.py -v | ||
|
|
||
| - name: Test imports | ||
| run: | | ||
| python -c "from src import config, distributed, logging_utils, metrics, workloads" | ||
| python -c "from src.sparsity import masks, semistructured" | ||
| python -c "from src.methods import dense_single, dense_tp, block_shock, masked_split_dense" | ||
|
|
||
| - name: Test main --help | ||
| run: | | ||
| python -m src.main --help | ||
|
|
||
| lint: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.10' | ||
|
|
||
| - name: Install linting tools | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install flake8 | ||
|
|
||
| - name: Lint with flake8 | ||
| run: | | ||
| # Stop the build if there are Python syntax errors or undefined names | ||
| flake8 src/ --count --select=E9,F63,F7,F82 --show-source --statistics | ||
| # Exit-zero treats all errors as warnings. Line length set to 100 | ||
| flake8 src/ --count --exit-zero --max-complexity=10 --max-line-length=100 --statistics | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow will run
pytest tests/test_masks.pywhich will fail due to undefined functionsgenerate_maskandvalidate_24_sparsity(as noted in the test file issues). This needs to be fixed before the CI can pass.