Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Libtorch 2.5.1 #1204

Merged
merged 57 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
31869b4
Update lantern.h to support libtorch v2.5
dfalbel Oct 31, 2024
95fa874
Point to libtorch 2.5.1
dfalbel Oct 31, 2024
35388fa
R wrappers update to work with LibTorch v 2.5.1
dfalbel Oct 31, 2024
8da7e2f
trigger rebuild with lantern tag
dfalbel Oct 31, 2024
494d0a9
Reorder includes
dfalbel Oct 31, 2024
a0c4f6c
Try upgrading to windows 2022
dfalbel Oct 31, 2024
c0b3472
Undef max on Windows
dfalbel Oct 31, 2024
f46e579
Also undef min
dfalbel Oct 31, 2024
5d078f7
Remove cuda 11.7 support
dfalbel Oct 31, 2024
22aad3b
Use our own pre-built binaries on both archs
dfalbel Oct 31, 2024
f01b089
Temporarily get Rcpp from GitHub because of a bug in the CRAN version
dfalbel Nov 1, 2024
bed291d
Try support for cuda 12.4
dfalbel Nov 1, 2024
30535cf
Fix compile warnings on linux
dfalbel Nov 1, 2024
11e6145
Upgrade CUDA toolkit installer action
dfalbel Nov 1, 2024
87636ff
Bump CUDA_STANDARD to 17
dfalbel Nov 1, 2024
eabf35e
Try making sure about cuDNN
dfalbel Nov 1, 2024
2893dad
Add required logfile suffix
dfalbel Nov 1, 2024
91ba1d1
Do not force cuda architectures and use torch's default.
dfalbel Nov 1, 2024
97e9b6d
Install nvtx on windows?
dfalbel Nov 1, 2024
24c492e
specify subpackages for windows
dfalbel Nov 1, 2024
001dd86
Do not install a subset of libs
dfalbel Nov 1, 2024
d588ff1
Other workaround
dfalbel Nov 1, 2024
d052354
Fix main workflow
dfalbel Nov 1, 2024
d2cceb5
Memory format must be set
dfalbel Nov 1, 2024
988c9b6
Fix code generation - specially for when `optional` values are used.
dfalbel Nov 4, 2024
425ed05
macos13 bump
dfalbel Nov 4, 2024
108ad91
Recover unpickler
dfalbel Nov 5, 2024
8c40a8c
Fix for Windows
dfalbel Nov 5, 2024
85a19be
Don't need to export LanternUnpicker?
dfalbel Nov 5, 2024
c8ff976
Fix API export
dfalbel Nov 5, 2024
899e1d5
No longer inherit
dfalbel Nov 5, 2024
d2a04b2
Fix include for linux
dfalbel Nov 5, 2024
86970cd
Fix test for now. See https://github.com/mlverse/torch/issues/1205
dfalbel Nov 5, 2024
c5c9082
Fix test case for now.
dfalbel Nov 5, 2024
b504d27
Join threads before deleting to avoid crashing.
dfalbel Nov 5, 2024
48534ad
Use detach to avoid deadlocking.
dfalbel Nov 5, 2024
ce0f46f
Try a different a approach at terminating the threads.
dfalbel Nov 6, 2024
967bc12
Update docs
dfalbel Nov 6, 2024
b0b015a
Fix torch_count_nonzero defaults
dfalbel Nov 6, 2024
99c4032
set a list of architectures for compilation
dfalbel Nov 6, 2024
c7621cc
Remove `:::` from call
dfalbel Nov 6, 2024
9c6d26f
Bump version to avoid wrong binary versions
dfalbel Nov 7, 2024
e7897ae
Print the sessionInfo
dfalbel Nov 8, 2024
6d277a8
fix key_padding_mask bug in `nnf_multi_head_attention_forward` (#1208)
MaximilianPi Nov 11, 2024
8531610
RTLD_DEEPBIND
dfalbel Nov 12, 2024
fab9e22
Merge branch 'libtorch/v2.5.1' of https://github.com/mlverse/torch in…
dfalbel Nov 12, 2024
e7ed07f
temporarily reduce CI scope
dfalbel Nov 12, 2024
dfaf32e
Bump supported versions
dfalbel Nov 12, 2024
b964821
Remove unncessary RTLD_GLOBAL flag.
dfalbel Nov 13, 2024
abfb8d9
Expand test for debugging.
dfalbel Nov 13, 2024
718b29d
Try more stable definition of positive definite. torch ones can lead …
dfalbel Nov 13, 2024
12ad6b0
Rm extended check
dfalbel Nov 13, 2024
619cbc6
Bump windows compiler version?
dfalbel Nov 14, 2024
c2980d3
Turn the pool into a unique opointer and never delete it fully to fix…
dfalbel Nov 14, 2024
d2242b2
Add more tolerance
dfalbel Nov 14, 2024
c46abfe
Back to full Lantern matrix
dfalbel Nov 14, 2024
ad815b0
Fix
dfalbel Nov 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/actions/install-cudnn/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,12 @@ runs:
Get-ChildItem -Path "${env:CUDA_PATH}\lib"
Get-ChildItem -Path "C:\cudnn\" -Directory | Move-Item -Destination "C:\cudnn\cuda"
Get-ChildItem -Path "C:\cudnn\"
Get-ChildItem -Path "C:\cudnn\cuda"
Move-Item -Path "C:\cudnn\cuda\bin\cudnn*.dll" -Destination "${env:CUDA_PATH}\bin"
Move-Item -Path "C:\cudnn\cuda\include\cudnn*.h" -Destination "${env:CUDA_PATH}\include"
Move-Item -Path "C:\cudnn\cuda\lib\cudnn*.lib" -Destination "${env:CUDA_PATH}\lib\x64"
echo "CUDNN_INCLUDE_PATH=""${CUDA_PATH}\include""" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CUDNN_LIBRARY_PATH=""${CUDA_PATH}\lib\x64""" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Move-Item -Path "C:\cudnn\cuda\lib\x64\cudnn*.lib" -Destination "${env:CUDA_PATH}\lib\x64"
echo "CUDNN_INCLUDE_PATH=""${env:CUDA_PATH}\include""" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "CUDNN_LIBRARY_PATH=""${env:CUDA_PATH}\lib\x64""" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
Remove-Item -Path cudnn.zip
shell: pwsh
4 changes: 3 additions & 1 deletion .github/actions/install-cudnn/cudnn-url.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
windows 11.3 https://torch-cdn.mlverse.org/cudnn/cudnn-11.3-windows-x64-v8.2.1.32.zip
windows 11.7 https://developer.download.nvidia.com/compute/redist/cudnn/v8.5.0/local_installers/11.7/cudnn-windows-x86_64-8.5.0.96_cuda11-archive.zip
windows 11.8 https://developer.download.nvidia.com/compute/redist/cudnn/v8.7.0/local_installers/11.8/cudnn-windows-x86_64-8.7.0.84_cuda11-archive.zip
windows 12.4 https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/windows-x86_64/cudnn-windows-x86_64-8.9.7.29_cuda12-archive.zip
linux 11.3 https://torch-cdn.mlverse.org/cudnn/cudnn-11.3-linux-x64-v8.2.1.32.tgz
linux 11.6 https://torch-cdn.mlverse.org/cudnn/cudnn-linux-x86_64-8.6.0.163_cuda11-archive.tgz
linux 10.2 https://torch-cdn.mlverse.org/cudnn/cudnn-10.2-linux-x64-v7.6.5.32.tgz
linux 11.7 https://torch-cdn.mlverse.org/cudnn/cudnn-linux-x86_64-8.5.0.96_cuda11-archive.tar.xz
linux 11.8 https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.9.0.131_cuda11-archive.tar.xz
linux 11.8 https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.9.0.131_cuda11-archive.tar.xz
linux 12.4 https://developer.download.nvidia.com/compute/cudnn/redist/cudnn/linux-x86_64/cudnn-linux-x86_64-8.9.7.29_cuda12-archive.tar.xz
23 changes: 11 additions & 12 deletions .github/workflows/lantern.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ jobs:
config:
# when changing supported versions here, please modify supported versions
# in install.R
- {os: macOS, version: cpu-intel, runner: macos-12}
- {os: macOS, version: cpu-intel, runner: macos-13}
- {os: macOS, version: cpu-m1, runner: [self-hosted, m1]}

- {os: ubuntu, version: cpu, runner: ubuntu-latest}
- {os: ubuntu, version: cu11.7, runner: [self-hosted, linux]}
- {os: ubuntu, version: cu11.8, runner: [self-hosted, linux]}
- {os: ubuntu, version: cu12.4, runner: [self-hosted, linux]}

- {os: windows, version: cpu, runner: windows-2019}
- {os: windows, version: cu11.7, runner: windows-2019}
- {os: windows, version: cpu, runner: windows-2022}
- {os: windows, version: cu11.8, runner: windows-2019}
- {os: windows, version: cu12.4, runner: windows-2019}

precxx11abi: [0, 1]

Expand All @@ -39,16 +39,14 @@ jobs:
- config: {os: ubuntu}
precxx11abi: 1
container: ubuntu:20.04

# specify the CUDA patch for each major/minor version.
# required for cuda installation
- config: {version: cu11.7}
cuda: 11.7
cuda_patch: 1

- config: {version: cu11.8}
cuda: 11.8
cuda_patch: 0

- config: {version: cu12.4}
cuda: 12.4
cuda_patch: 1

exclude:
- config: {os: macOS}
Expand Down Expand Up @@ -80,17 +78,18 @@ jobs:

- name: Install CUDA
if: ${{matrix.cuda != ''}}
uses: Jimver/[email protected].10
uses: Jimver/[email protected].18
id: cuda-toolkit
with:
cuda: "${{matrix.cuda}}.${{matrix.cuda_patch}}"
log-file-suffix: '${{matrix.cuda}}.${{matrix.cuda_patch}}.${{matrix.precxx11abi}}.txt'

- name: Install CuDNN
if: ${{ matrix.cuda != '' }}
uses: ./.github/actions/install-cudnn
with:
cuda_version: ${{ matrix.cuda }}

- name: Run cmake
run: |
cd src/lantern/
Expand Down
25 changes: 10 additions & 15 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,14 @@ jobs:

- {os: ubuntu, r_version: release, version: cpu, runner: ubuntu-20.04}
- {os: ubuntu, r_version: release, version: cpu, runner: ubuntu-20.04, precxx11abi: 1}
- {os: ubuntu, r_version: release, version: cu11.7, runner: [self-hosted, gpu-local]}
- {os: ubuntu, r_version: release, version: cu11.8, runner: [self-hosted, gpu-local]}
- {os: ubuntu, r_version: release, version: cu12.4, runner: [self-hosted, gpu-local]}

- {os: windows, r_version: release, version: cpu, runner: windows-latest}

include:

- config: {os: ubuntu, version: cu11.7}
container: {image: 'nvidia/cuda:11.7.1-cudnn8-devel-ubuntu20.04', options: '--gpus all --runtime=nvidia'}

- config: {os: ubuntu, version: cu11.8}
container: {image: 'nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04', options: '--gpus all --runtime=nvidia'}
- config: {os: ubuntu, version: cu12.4}
container: {image: 'nvidia/cuda:12.4.1-cudnn-devel-ubuntu20.04', options: '--gpus all --runtime=nvidia'}

runs-on: ${{ matrix.config.runner }}
container: ${{ matrix.container }}
Expand Down Expand Up @@ -79,7 +75,7 @@ jobs:
- uses: ./.github/actions/setup-r
with:
r_version: ${{ matrix.config.r_version}}

- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1
if: ${{ env.BUILD_LANTERN == 1}}
Expand All @@ -91,16 +87,15 @@ jobs:
cache: false
extra-packages: any::rcmdcheck
needs: check

- run: |
Sys.getenv("PRECXX11ABI")
Sys.setenv("PRECXX11ABI" = 1)
pkgbuild::build()
shell: Rscript {0}


- name: Session info
run: |
Rscript -e "sessionInfo()"

- uses: r-lib/actions/check-r-package@v2
with:
error-on: '"error"'
args: 'c("--no-multiarch", "--no-manual", "--as-cran")'



10 changes: 7 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: torch
Type: Package
Title: Tensors and Neural Networks with 'GPU' Acceleration
Version: 0.13.0.9000
Version: 0.13.0.9001
Authors@R: c(
person("Daniel", "Falbel", email = "[email protected]", role = c("aut", "cre", "cph")),
person("Javier", "Luraschi", email = "[email protected]", role = c("aut")),
Expand All @@ -11,6 +11,7 @@ Authors@R: c(
person("Krzysztof", "Joachimiak", role = c("ctb")),
person("Hamada S.", "Badr", role = c("ctb")),
person("Sebastian", "Fischer", role = c("ctb")),
person("Maximilian", "Pichler", role = c("ctb")),
person(family = "RStudio", role = c("cph"))
)
Description: Provides functionality to define and train neural networks similar to
Expand Down Expand Up @@ -43,8 +44,9 @@ Imports:
glue,
desc,
safetensors (>= 0.1.1),
jsonlite
RoxygenNote: 7.3.1
jsonlite,
scales
RoxygenNote: 7.3.2
Roxygen: list(markdown = TRUE)
Suggests:
testthat (>= 3.0.0),
Expand Down Expand Up @@ -177,3 +179,5 @@ Collate:
'variable_list.R'
'with-indices.R'
'wrapers.R'
Remotes:
RcppCore/Rcpp
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Bug fixes

- `torch_iinfo()` now support all integer dtypes (#1190 @cregouby)
- Fixed float key_padding_mask in `nnf_multi_head_attention_forward()` (#1205)

# torch 0.13.0

Expand Down
Loading
Loading