mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-11 23:14:50 +08:00
Merge build-cuda and build-linux actions
This commit is contained in:
26
.github/actions/build-cuda/action.yml
vendored
26
.github/actions/build-cuda/action.yml
vendored
@@ -1,26 +0,0 @@
|
|||||||
name: 'Build and Test with CUDA'
|
|
||||||
description: 'Build and test MLX with CUDA'
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
toolkit:
|
|
||||||
description: 'The CUDA toolkit'
|
|
||||||
required: true
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- name: Install Python package
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
DEBUG: 1
|
|
||||||
CMAKE_ARGS: -DMLX_BUILD_CUDA=ON -DCMAKE_COMPILE_WARNING_AS_ERROR=ON -DCMAKE_CUDA_COMPILER=/usr/local/${{ inputs.toolkit }}/bin/nvcc
|
|
||||||
run: pip install --no-build-isolation -e ".[dev]" -v
|
|
||||||
|
|
||||||
- name: Build CPP only
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cmake . -B build \
|
|
||||||
-DMLX_BUILD_CUDA=ON \
|
|
||||||
-DCMAKE_CUDA_COMPILER=/usr/local/${{ inputs.toolkit }}/bin/nvcc \
|
|
||||||
-DCMAKE_BUILD_TYPE=DEBUG
|
|
||||||
cmake --build build -j $(nproc)
|
|
||||||
26
.github/actions/build-linux/action.yml
vendored
26
.github/actions/build-linux/action.yml
vendored
@@ -1,13 +1,30 @@
|
|||||||
name: 'Build and Test on Linux'
|
name: 'Build and Test on Linux'
|
||||||
description: 'Build and test MLX on Linux'
|
|
||||||
|
inputs:
|
||||||
|
toolkit:
|
||||||
|
description: 'The toolkit to build with'
|
||||||
|
required: false
|
||||||
|
default: 'cpu'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
|
- name: Set cmake args
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
CMAKE_ARGS_CPU: >
|
||||||
|
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON
|
||||||
|
-DMLX_BUILD_CUDA=OFF
|
||||||
|
CMAKE_ARGS_CUDA: >
|
||||||
|
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON
|
||||||
|
-DCMAKE_CUDA_COMPILER=/usr/local/${{ inputs.toolkit }}/bin/nvcc
|
||||||
|
-DMLX_BUILD_CUDA=ON
|
||||||
|
run: |
|
||||||
|
echo CMAKE_ARGS="$CMAKE_ARGS_${{ startsWith(inputs.toolkit, 'cuda') && 'CUDA' || 'CPU' }}" > $GITHUB_ENV
|
||||||
|
|
||||||
- name: Install Python package
|
- name: Install Python package
|
||||||
shell: sh
|
shell: sh
|
||||||
env:
|
env:
|
||||||
CMAKE_ARGS: "-DCMAKE_COMPILE_WARNING_AS_ERROR=ON"
|
|
||||||
DEBUG: 1
|
DEBUG: 1
|
||||||
run: pip install --no-build-isolation -e ".[dev]" -v
|
run: pip install --no-build-isolation -e ".[dev]" -v
|
||||||
|
|
||||||
@@ -20,6 +37,5 @@ runs:
|
|||||||
- name: Build CPP only
|
- name: Build CPP only
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir -p build && cd build
|
cmake . -B build -DCMAKE_BUILD_TYPE=Debug ${{ env.CMAKE_ARGS }}
|
||||||
cmake .. -DMLX_BUILD_METAL=OFF -DCMAKE_BUILD_TYPE=DEBUG
|
cmake --build build -j $(nproc)
|
||||||
make -j $(nproc)
|
|
||||||
|
|||||||
2
.github/workflows/pull_request.yml
vendored
2
.github/workflows/pull_request.yml
vendored
@@ -66,7 +66,7 @@ jobs:
|
|||||||
- uses: ./.github/actions/setup-linux
|
- uses: ./.github/actions/setup-linux
|
||||||
with:
|
with:
|
||||||
toolkit: ${{ matrix.toolkit }}
|
toolkit: ${{ matrix.toolkit }}
|
||||||
- uses: ./.github/actions/build-cuda
|
- uses: ./.github/actions/build-linux
|
||||||
with:
|
with:
|
||||||
toolkit: ${{ matrix.toolkit }}
|
toolkit: ${{ matrix.toolkit }}
|
||||||
- uses: ./.github/actions/test-linux
|
- uses: ./.github/actions/test-linux
|
||||||
|
|||||||
Reference in New Issue
Block a user