Skip to content

Commit

Permalink
ZLUDA 3.8.3 (#40)
Browse files Browse the repository at this point in the history
* Update README.md.

* Add --version argument.

* Remove unused files.

* Revive ROCm 5 support for Windows.

* Update GitHub Actions.

* Update GitHub Actions.

* Bump version.
  • Loading branch information
lshqqytiger authored Aug 26, 2024
1 parent 2f2e38a commit 1c238a9
Show file tree
Hide file tree
Showing 33 changed files with 15,154 additions and 10,014 deletions.
29 changes: 26 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,45 @@ jobs:
run: |
cargo xtask -r
build_win:
build_win_5:
name: Build (Windows)
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install AMD HIP SDK
- name: Install AMD HIP SDK 5.7
run: |
C:\msys64\usr\bin\wget.exe https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-23.Q4-Win10-Win11-For-HIP.exe -O "amdgpu-install.exe"
.\amdgpu-install.exe -Install -View:1
Start-Sleep -Seconds 60
$setupId = (Get-Process ATISetup).id
Wait-Process -Id $setupId
- uses: Swatinem/rust-cache@v2
- name: Build for ROCm 5.x
run: |
$ROCm_PATH = "C:\Program Files\AMD\ROCm"
$Env:HIP_PATH = "$ROCm_PATH\$(Get-ChildItem -Path $ROCm_PATH -Name)"
$Env:PATH = "$Env:HIP_PATH\bin;$Env:PATH"
$Env:HIP_PATH = "$Env:HIP_PATH\"
cargo xtask -r --rocm5
build_win_6:
name: Build (Windows)
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install AMD HIP SDK 6.1
run: |
C:\msys64\usr\bin\wget.exe https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-24.Q3-Win10-Win11-For-HIP.exe -O "amdgpu-install.exe"
.\amdgpu-install.exe -Install -View:1
Start-Sleep -Seconds 60
$setupId = (Get-Process ATISetup).id
Wait-Process -Id $setupId
- uses: Swatinem/rust-cache@v2
- name: Build
- name: Build for ROCm 6.x
run: |
$ROCm_PATH = "C:\Program Files\AMD\ROCm"
$Env:HIP_PATH = "$ROCm_PATH\$(Get-ChildItem -Path $ROCm_PATH -Name)"
Expand Down
52 changes: 47 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,23 +77,65 @@ jobs:
asset_name: ZLUDA-linux-amd64.tar.gz
asset_content_type: application/gzip

build_win:
build_win_5:
name: Build and publish (Windows)
runs-on: windows-2019
needs: release
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install AMD HIP SDK
- name: Install AMD HIP SDK 5.7
run: |
C:\msys64\usr\bin\wget.exe https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-23.Q4-Win10-Win11-For-HIP.exe -O "amdgpu-install.exe"
.\amdgpu-install.exe -Install -View:1
Start-Sleep -Seconds 60
$setupId = (Get-Process ATISetup).id
Wait-Process -Id $setupId
- uses: Swatinem/rust-cache@v2
- name: Build for ROCm 5.x
run: |
$ROCm_PATH = "C:\Program Files\AMD\ROCm"
$Env:HIP_PATH = "$ROCm_PATH\$(Get-ChildItem -Path $ROCm_PATH -Name)"
$Env:PATH = "$Env:HIP_PATH\bin;$Env:PATH"
$Env:HIP_PATH = "$Env:HIP_PATH\"
cargo xtask zip -r --rocm5
Expand-Archive -Path target/release/zluda.zip -DestinationPath target/release
# https://stackoverflow.com/a/74033027
- name: Set revision hash
run: echo "SHORT_SHA=$("${{ github.sha }}".SubString(0, 7))" >> $env:GITHUB_ENV
- name: Upload (artifact)
uses: actions/upload-artifact@v4
with:
name: zluda-windows-rocm5-${{ env.SHORT_SHA }}
path: target/release/zluda
- name: Upload (release)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: target/release/zluda.zip
asset_name: ZLUDA-windows-rocm5-amd64.zip
asset_content_type: application/zip

build_win_6:
name: Build and publish (Windows)
runs-on: windows-2019
needs: release
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install AMD HIP SDK 6.1
run: |
C:\msys64\usr\bin\wget.exe https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-24.Q3-Win10-Win11-For-HIP.exe -O "amdgpu-install.exe"
.\amdgpu-install.exe -Install -View:1
Start-Sleep -Seconds 60
$setupId = (Get-Process ATISetup).id
Wait-Process -Id $setupId
- uses: Swatinem/rust-cache@v2
- name: Build
- name: Build for ROCm 6.x
run: |
$ROCm_PATH = "C:\Program Files\AMD\ROCm"
$Env:HIP_PATH = "$ROCm_PATH\$(Get-ChildItem -Path $ROCm_PATH -Name)"
Expand All @@ -107,7 +149,7 @@ jobs:
- name: Upload (artifact)
uses: actions/upload-artifact@v4
with:
name: zluda-windows-${{ env.SHORT_SHA }}
name: zluda-windows-rocm6-${{ env.SHORT_SHA }}
path: target/release/zluda
- name: Upload (release)
uses: actions/upload-release-asset@v1
Expand All @@ -116,5 +158,5 @@ jobs:
with:
upload_url: ${{ needs.release.outputs.upload_url }}
asset_path: target/release/zluda.zip
asset_name: ZLUDA-windows-amd64.zip
asset_name: ZLUDA-windows-rocm6-amd64.zip
asset_content_type: application/zip
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,26 @@ Performance is currently much lower than the native HIP backend, see the discuss
torch.backends.cuda.enable_mem_efficient_sdp(False)
```

If you are getting an error about nvrtc/hiprtc, insert

```py
def jit_script(f, *_, **__):
f.graph = torch._C.Graph() # pylint: disable=protected-access
return f
torch.jit.script = jit_script
```

You may have an issue while running `torch.topk`. If so, insert

```py
_topk = torch.topk
def topk(tensor: torch.Tensor, *args, **kwargs):
device = tensor.device
values, indices = _topk(tensor.cpu(), *args, **kwargs)
return torch.return_types.topk((values.to(device), indices.to(device),))
torch.topk = topk
```

#### 3DF Zephyr

- ZLUDA is much slower than CUDA.
Expand Down
3 changes: 3 additions & 0 deletions comgr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ version = "0.0.0"
authors = ["Andrzej Janik <[email protected]>"]
edition = "2018"

[features]
rocm5 = ["hip_common/rocm5"]

[lib]

[dependencies]
Expand Down
Loading

0 comments on commit 1c238a9

Please sign in to comment.