Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Fixed workflow to run on new github actions runners (#25)
Browse files Browse the repository at this point in the history
* Removed conda and packages installation because they are now included in image

Signed-off-by: Gregory Shimansky <[email protected]>

* Fixed conda command line

Signed-off-by: Gregory Shimansky <[email protected]>

* Fixed conda command lines

Signed-off-by: Gregory Shimansky <[email protected]>

* DEBUG1

* Added conda bash hook to build mlir script

* More fixes to run conda from script

* Fixed conda activate in workflows

* Added --solver libmamba explicit switch

Signed-off-by: Gregory Shimansky <[email protected]>

---------

Signed-off-by: Gregory Shimansky <[email protected]>
  • Loading branch information
gshimansky authored Dec 1, 2023
1 parent c3d1b5b commit 568475f
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 30 deletions.
7 changes: 0 additions & 7 deletions .github/actions/build_mlir/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ runs:
path: torch-mlir
ref: 'cpu-proto'
submodules: recursive
- name: Install system and Intel packages
shell: bash -el {0}
run: |
curl https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
sudo apt-get install -y build-essential intel-basekit
- name: Build torch-mlir
shell: bash -el {0}
run: |
Expand Down
22 changes: 5 additions & 17 deletions .github/actions/initial_setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ inputs:
runs:
using: composite
steps:
- uses: conda-incubator/setup-miniconda@v2
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
activate-environment: ${{ inputs.conda_env }}-test

- name: Get Date
id: get-date
run: echo "today=$(/bin/date -u '+%Y%m%d')" >> $GITHUB_OUTPUT
Expand All @@ -31,7 +24,7 @@ runs:
uses: actions/cache@v3
env:
# Increase this value to reset cache if etc/example-environment.yml has not changed
CACHE_NUMBER: 0
CACHE_NUMBER: 2
with:
path: ${{ env.CONDA }}/envs
key: >-
Expand All @@ -43,18 +36,13 @@ runs:
- name: Update conda env
if: steps.conda-cache.outputs.cache-hit != 'true'
shell: bash -el {0}
run: mamba env update -n ${{ inputs.conda_env }}-test -f tests/conda-envs/${{ inputs.conda_env }}.yaml
run: ${CONDA}/bin/conda env update --solver libmamba -n ${{ inputs.conda_env }} -f tests/conda-envs/${{ inputs.conda_env }}.yaml

- uses: ./.github/actions/build_mlir
if: ${{ inputs.conda_env == 'mlir' }}

- name: Install compiler for dynamo
shell: bash -el {0}
run: |
sudo apt-get update
sudo apt-get install -y build-essential
if: ${{ inputs.compiler == 'dynamo' }}

- name: Setup benchmarks package
shell: bash -el {0}
run: pip install -e .
run: |
source ${CONDA}/bin/activate ${{ inputs.conda_env }}
pip install -e .
1 change: 1 addition & 0 deletions .github/workflows/mlp-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
- name: Run MLP test on specific compiler
shell: bash -el {0}
run: |
source ${CONDA}/bin/activate ${{ inputs.conda_env }}
benchmark-run \
--host spr \
--benchmark mlp \
Expand Down
2 changes: 1 addition & 1 deletion tests/conda-envs/cpu.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: cpu-test
name: cpu
channels:
- pytorch
dependencies:
Expand Down
2 changes: 1 addition & 1 deletion tests/conda-envs/cuda.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: cuda-test
name: cuda
channels:
- pytorch
- nvidia
Expand Down
2 changes: 1 addition & 1 deletion tests/conda-envs/ipex.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ipex-test
name: ipex
channels:
- intel
- conda-forge
Expand Down
2 changes: 1 addition & 1 deletion tests/conda-envs/mlir.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: mlir-test
name: mlir
channels:
- intel
dependencies:
Expand Down
Empty file added tests/docker/README.md
Empty file.
5 changes: 4 additions & 1 deletion tests/scripts/build-mlir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ if (( $# != 1 )); then
>&2 echo "Need path to torch-mlir repository as an argument."
fi

conda activate mlir-test
source ${CONDA}/bin/activate mlir

env
${CONDA}/bin/conda list

cd $1
pip install -r requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion tests/scripts/create-mlir-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ fi

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
./create-env.sh ${SCRIPT_DIR}/../conda-envs/mlir.yaml
source ${CONDA_PREFIX}/bin/activate mlir-test
source ${CONDA}/bin/activate mlir
pip install -r $1/requirements.txt

0 comments on commit 568475f

Please sign in to comment.