support grain checkpoint (#133) #2167
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
# Copyright 2024 Google LLC | |
# | |
# 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 | |
# | |
# https://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. | |
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Unit Test | |
on: | |
pull_request: | |
push: | |
branches: [ "main" ] | |
workflow_dispatch: | |
schedule: | |
# Run the job every 12 hours | |
- cron: '0 */12 * * *' | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
tpu-type: ["v4-8"] | |
name: "TPU test (${{ matrix.tpu-type }})" | |
runs-on: ["self-hosted", "tpu", "${{ matrix.tpu-type }}"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies | |
run: | | |
pip install -e . | |
pip uninstall jax jaxlib libtpu-nightly libtpu -y | |
bash setup.sh MODE=stable | |
export PATH=$PATH:$HOME/.local/bin | |
pip install ruff | |
pip install isort | |
pip install pytest | |
- name: Analysing the code with ruff | |
run: | | |
ruff check . | |
- name: PyTest | |
run: | | |
HF_HUB_CACHE=/mnt/disks/github-runner-disk/ HF_HOME=/mnt/disks/github-runner-disk/ python3 -m pytest | |
# add_pull_ready: | |
# if: github.ref != 'refs/heads/main' | |
# permissions: | |
# checks: read | |
# pull-requests: write | |
# needs: build | |
# uses: ./.github/workflows/AddLabel.yml |