From da9efc5a4010fa82b5dfc04edde6286aebbca560 Mon Sep 17 00:00:00 2001 From: David Chavez Date: Mon, 26 Jan 2026 21:26:24 +0100 Subject: [PATCH] Enable macos CI --- .github/workflows/test-gpu.yml | 115 +++++++++++++++++---------------- crates/burn-wgpu/src/lib.rs | 5 +- 2 files changed, 63 insertions(+), 57 deletions(-) diff --git a/.github/workflows/test-gpu.yml b/.github/workflows/test-gpu.yml index 120591d171d..1efcb26eac3 100644 --- a/.github/workflows/test-gpu.yml +++ b/.github/workflows/test-gpu.yml @@ -50,19 +50,21 @@ jobs: needs: [prepare-checks] timeout-minutes: 60 # '@id:' label must be unique within this worklow - runs-on: [ - '@id:burn-cuda-job-${{github.run_id}}-${{github.run_attempt}}', - '@pr_number:${{ inputs.pr_number }}', - '@organization:tracel-ai', - '@repository:burn', - '@image-family:${{ needs.prepare-checks.outputs.gcp_runners_image_family }}', - '@machine-type:${{ needs.prepare-checks.outputs.gcp_runners_machine_type }}', - '@zones:${{ needs.prepare-checks.outputs.gcp_runners_zone }}', - '@gpu:true' ] + runs-on: + [ + "@id:burn-cuda-job-${{github.run_id}}-${{github.run_attempt}}", + "@pr_number:${{ inputs.pr_number }}", + "@organization:tracel-ai", + "@repository:burn", + "@image-family:${{ needs.prepare-checks.outputs.gcp_runners_image_family }}", + "@machine-type:${{ needs.prepare-checks.outputs.gcp_runners_machine_type }}", + "@zones:${{ needs.prepare-checks.outputs.gcp_runners_zone }}", + "@gpu:true", + ] env: - LD_LIBRARY_PATH: '/usr/local/cuda/lib64' + LD_LIBRARY_PATH: "/usr/local/cuda/lib64" # disable incremental compilation (reduces artifact size) - CARGO_PROFILE_TEST_INCREMENTAL: 'false' + CARGO_PROFILE_TEST_INCREMENTAL: "false" # Keep the stragegy to be able to easily add new rust versions if required strategy: matrix: @@ -84,18 +86,20 @@ jobs: needs: [prepare-checks] timeout-minutes: 60 # '@id:' label must be unique within this worklow - runs-on: [ - '@id:burn-vulkan-job-${{github.run_id}}-${{github.run_attempt}}', - '@pr_number:${{ inputs.pr_number }}', - '@organization:tracel-ai', - '@repository:burn', - '@image-family:${{ needs.prepare-checks.outputs.gcp_runners_image_family }}', - '@machine-type:${{ needs.prepare-checks.outputs.gcp_runners_machine_type }}', - '@zones:${{ needs.prepare-checks.outputs.gcp_runners_zone }}', - '@gpu:true' ] + runs-on: + [ + "@id:burn-vulkan-job-${{github.run_id}}-${{github.run_attempt}}", + "@pr_number:${{ inputs.pr_number }}", + "@organization:tracel-ai", + "@repository:burn", + "@image-family:${{ needs.prepare-checks.outputs.gcp_runners_image_family }}", + "@machine-type:${{ needs.prepare-checks.outputs.gcp_runners_machine_type }}", + "@zones:${{ needs.prepare-checks.outputs.gcp_runners_zone }}", + "@gpu:true", + ] env: # disable incremental compilation (reduces artifact size) - CARGO_PROFILE_TEST_INCREMENTAL: 'false' + CARGO_PROFILE_TEST_INCREMENTAL: "false" # Keep the stragegy to be able to easily add new rust versions if required strategy: matrix: @@ -117,18 +121,20 @@ jobs: needs: [prepare-checks] timeout-minutes: 60 # '@id:' label must be unique within this worklow - runs-on: [ - '@id:burn-wgpu-job-${{github.run_id}}-${{github.run_attempt}}', - '@pr_number:${{ inputs.pr_number }}', - '@organization:tracel-ai', - '@repository:burn', - '@image-family:${{ needs.prepare-checks.outputs.gcp_runners_image_family }}', - '@machine-type:${{ needs.prepare-checks.outputs.gcp_runners_machine_type }}', - '@zones:${{ needs.prepare-checks.outputs.gcp_runners_zone }}', - '@gpu:true' ] + runs-on: + [ + "@id:burn-wgpu-job-${{github.run_id}}-${{github.run_attempt}}", + "@pr_number:${{ inputs.pr_number }}", + "@organization:tracel-ai", + "@repository:burn", + "@image-family:${{ needs.prepare-checks.outputs.gcp_runners_image_family }}", + "@machine-type:${{ needs.prepare-checks.outputs.gcp_runners_machine_type }}", + "@zones:${{ needs.prepare-checks.outputs.gcp_runners_zone }}", + "@gpu:true", + ] env: # disable incremental compilation (reduces artifact size) - CARGO_PROFILE_TEST_INCREMENTAL: 'false' + CARGO_PROFILE_TEST_INCREMENTAL: "false" # Keep the stragegy to be able to easily add new rust versions if required strategy: matrix: @@ -146,27 +152,26 @@ jobs: - name: Tests (burn-wgpu) run: cargo xtask test ${{ env.TEST_RELEASE_FLAG }} --ci gcp-wgpu-runner -# TODO: fix macos CI tests (M2 virtualization) - # macos-std-metal-tests: - # runs-on: blaze/macos-14 - # needs: [prepare-checks] - # timeout-minutes: 60 - # # Keep the stragegy to be able to easily add new rust versions if required - # strategy: - # matrix: - # rust: [stable] - # include: - # - rust: stable - # toolchain: stable - # steps: - # - name: Setup Rust - # uses: tracel-ai/github-actions/setup-rust@v6 - # with: - # rust-toolchain: ${{ matrix.toolchain }} - # cache-key: ${{ matrix.rust }}-macos - # # -------------------------------------------------------------------------------- - # - name: Device check - # run: system_profiler SPHardwareDataType - # # -------------------------------------------------------------------------------- - # - name: Tests - # run: cargo xtask test ${{ env.TEST_RELEASE_FLAG }} --ci github-mac-runner + macos-std-metal-tests: + runs-on: blaze/macos-15 + needs: [prepare-checks] + timeout-minutes: 60 + # Keep the stragegy to be able to easily add new rust versions if required + strategy: + matrix: + rust: [stable] + include: + - rust: stable + toolchain: stable + steps: + - name: Setup Rust + uses: tracel-ai/github-actions/setup-rust@v6 + with: + rust-toolchain: ${{ matrix.toolchain }} + cache-key: ${{ matrix.rust }}-macos + # -------------------------------------------------------------------------------- + - name: Device check + run: system_profiler SPHardwareDataType + # -------------------------------------------------------------------------------- + - name: Tests + run: cargo xtask test ${{ env.TEST_RELEASE_FLAG }} --ci github-mac-runner diff --git a/crates/burn-wgpu/src/lib.rs b/crates/burn-wgpu/src/lib.rs index b81654d7c58..c1bac3dddfa 100644 --- a/crates/burn-wgpu/src/lib.rs +++ b/crates/burn-wgpu/src/lib.rs @@ -148,12 +148,13 @@ mod tests { { assert!(B::supports_dtype(&device, DType::F16)); assert!(B::supports_dtype(&device, DType::I16)); + assert!(B::supports_dtype(&device, DType::I8)); assert!(B::supports_dtype(&device, DType::U16)); + assert!(B::supports_dtype(&device, DType::U8)); assert!(!B::supports_dtype(&device, DType::F64)); + assert!(!B::supports_dtype(&device, DType::BF16)); assert!(!B::supports_dtype(&device, DType::Flex32)); - assert!(!B::supports_dtype(&device, DType::I8)); - assert!(!B::supports_dtype(&device, DType::U8)); } #[cfg(not(any(feature = "vulkan", feature = "metal")))]