Update Helix-mRNA notebook and add coverage badge to repo #518
This file contains 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
name: CI Pipeline | |
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
tests: | |
runs-on: self-hosted | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11.8 | |
- name: Install dependencies | |
run: | | |
pip install -r requirements-dev.txt | |
pip install .[mamba-ssm] | |
# First download before tests as they make use of the downloaded files | |
- name: Download all files | |
run: | | |
python ci/download_all.py | |
- name: Execute unittests | |
run: | | |
CUDA_VISIBLE_DEVICES=-1 pytest --cov-report=html:html_cov --cov-branch --cov-report term --cov=helical ci/ | |
- name: Upload coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: html_cov/ | |
coverage-badge: | |
needs: tests | |
runs-on: self-hosted | |
steps: | |
- name: Generate coverage badge | |
if: | | |
!(github.event.pull_request.changed_files == 1 && contains(github.event.pull_request.changed_files, 'assets/coverage.svg')) | |
uses: tj-actions/coverage-badge-py@v2 | |
- name: Verify Changed files | |
uses: tj-actions/verify-changed-files@v16 | |
id: verify-changed-files | |
with: | |
files: coverage.svg | |
- name: Commit files | |
if: steps.verify-changed-files.outputs.files_changed == 'true' | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
rm -f assets/coverage.svg | |
git add -u assets/ | |
git commit -m "Remove old coverage badge" | |
mv coverage.svg assets/ | |
git add assets/coverage.svg | |
git commit -m "Add new coverage badge" | |
git push origin HEAD:${{ github.head_ref }} | |
integration-tests: | |
needs: tests | |
runs-on: self-hosted | |
if: | | |
(github.event.pull_request.changed_files == 1 && contains(github.event.pull_request.changed_files, 'assets/coverage.svg')) | |
env: | |
CUDA_VISIBLE_DEVICES: 0 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11.8 | |
# because jobs may not be run in the same order, we need to install the dependencies again | |
- name: Install helical | |
run: | | |
pip install .[mamba-ssm] | |
# Required to get the data | |
- name: Download all files | |
run: | | |
python ci/download_all.py | |
- name: Execute Geneformer v1 | |
run: | | |
python examples/run_models/run_geneformer.py ++model_name="gf-12L-30M-i2048" ++device="cuda" | |
- name: Fine-tune Geneformer v1 | |
run: | | |
python examples/fine_tune_models/fine_tune_geneformer.py ++model_name="gf-12L-30M-i2048" ++device="cuda" | |
- name: Execute Geneformer v2 | |
run: | | |
python examples/run_models/run_geneformer.py ++model_name="gf-12L-95M-i4096" ++device="cuda" | |
- name: Fine-tune Geneformer v2 | |
run: | | |
python examples/fine_tune_models/fine_tune_geneformer.py ++model_name="gf-12L-30M-i2048" ++device="cuda" | |
- name: Execute scGPT | |
run: | | |
python examples/run_models/run_scgpt.py ++device="cuda" | |
- name: Fine-tune scGPT | |
run: | | |
python examples/fine_tune_models/fine_tune_scgpt.py ++device="cuda" | |
- name: Execute UCE | |
run: | | |
python examples/run_models/run_uce.py ++device="cuda" | |
- name: Fine-tune UCE | |
run: | | |
python examples/fine_tune_models/fine_tune_UCE.py ++device="cuda" | |
- name: Execute Hyena | |
run: | | |
python examples/run_models/run_hyena_dna.py ++device="cuda" | |
- name: Execute Hyena | |
run: | | |
python examples/fine_tune_models/fine_tune_hyena_dna.py ++device="cuda" | |
- name: Execute Helix-mRNA | |
run: | | |
python examples/run_models/run_helix_mrna.py ++device="cuda" | |
- name: Fine-tune Helix-mRNA | |
run: | | |
python examples/fine_tune_models/fine_tune_helix_mrna.py ++device="cuda" | |
- name: Execute Mamba2-mRNA | |
run: | | |
python examples/run_models/run_mamba2_mrna.py ++device="cuda" | |
- name: Fine-tune Mamba2-mRNA | |
run: | | |
python examples/fine_tune_models/fine_tune_mamba2_mrna.py ++device="cuda" | |
- name: Execute Caduceus | |
run: | | |
python examples/run_models/run_caduceus.py | |
- name: Fine-tune Caduceus | |
run: | | |
python examples/fine_tune_models/fine_tune_caduceus.py | |
notebooks: | |
needs: tests | |
runs-on: self-hosted | |
if: | | |
(github.event.pull_request.changed_files == 1 && contains(github.event.pull_request.changed_files, 'assets/coverage.svg')) | |
env: | |
CUDA_VISIBLE_DEVICES: 0 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.11.8 | |
# because jobs may not be run in the same order, we need to install the dependencies again | |
- name: Install helical | |
run: | | |
pip install .[mamba-ssm] | |
- name: Reduce datasets to speedup checks | |
run: | | |
sed -i 's/train\[:65%\]/train\[:5%\]/g' ./examples/notebooks/Cell-Type-Annotation.ipynb | |
sed -i 's/train\[70%:\]/train\[5%:7%\]/g' ./examples/notebooks/Cell-Type-Annotation.ipynb | |
sed -i 's/get_anndata_from_hf_dataset(ds\[\\"train\\"\])/get_anndata_from_hf_dataset(ds\[\\"train\\"\])[:100]/g' ./examples/notebooks/Cell-Type-Classification-Fine-Tuning.ipynb | |
sed -i 's/get_anndata_from_hf_dataset(ds\[\\"test\\"\])/get_anndata_from_hf_dataset(ds\[\\"test\\"\])[:10]/g' ./examples/notebooks/Cell-Type-Classification-Fine-Tuning.ipynb | |
sed -i 's/list(np.array(train_dataset.obs\[\\"LVL1\\"].tolist()))/list(np.array(train_dataset.obs\[\\"LVL1\\"].tolist()))[:100]/g' ./examples/notebooks/Cell-Type-Classification-Fine-Tuning.ipynb | |
sed -i 's/list(np.array(test_dataset.obs\[\\"LVL1\\"].tolist()))/list(np.array(test_dataset.obs\[\\"LVL1\\"].tolist()))[:10]/g' ./examples/notebooks/Cell-Type-Classification-Fine-Tuning.ipynb | |
- name: Run Notebooks | |
run: | | |
pytest --durations=0 --nbmake ./examples/notebooks/*.ipynb |