From 47c3dd7880999e48660e4493901f1750a916c29f Mon Sep 17 00:00:00 2001 From: Yifei Teng Date: Wed, 8 Jan 2025 15:24:41 -0800 Subject: [PATCH] Add a CPU check and CI Similar to https://github.com/AI-Hypercomputer/torchprime/pull/13, we also add a CPU github action. This action will run `pytest` on the repo. Currently there is only one test, which is the Llama test in torch_xla_models. In order to run the test today, we need a HF_TOKEN. I created a personal read only token and https://github.com/AI-Hypercomputer/torchprime/issues/14 tracks avoiding the need for HF_TOKEN, after which I'll need to remember to invalidate the token. --- .github/workflows/cpu_test.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/cpu_test.yml diff --git a/.github/workflows/cpu_test.yml b/.github/workflows/cpu_test.yml new file mode 100644 index 0000000..47c4208 --- /dev/null +++ b/.github/workflows/cpu_test.yml @@ -0,0 +1,31 @@ +name: CPU tests + +on: + push: + branches: + - main + pull_request: + schedule: + - cron: "0 8 * * *" + +jobs: + lint: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.10", "3.11", "3.12"] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python-version }} + - name: Install dev dependencies + run: | + python -m pip install --upgrade pip + pip install -e '.[dev]' + - name: Run PyTest + run: | + # TODO(https://github.com/AI-Hypercomputer/torchprime/issues/14): Remove and burn the token. + export HF_TOKEN=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 + pytest