From dc8f07da90d31ef36c7208649d2bb8a9bbcc7502 Mon Sep 17 00:00:00 2001 From: laurent Date: Thu, 13 Jun 2024 15:28:55 +0200 Subject: [PATCH 1/3] Update for 0.7.0. --- .github/workflows/rust-ci.yml | 6 +++--- Cargo.toml | 2 +- README.md | 6 +++--- xla_rs/xla_rs.cc | 5 +++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index f6bb6b3..9c1871c 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -18,7 +18,7 @@ jobs: toolchain: ${{ matrix.rust }} override: true - run: | - wget -nv https://github.com/elixir-nx/xla/releases/download/v0.5.1/xla_extension-x86_64-linux-gnu-cpu.tar.gz + wget -nv https://github.com/elixir-nx/xla/releases/download/v0.7.0/xla_extension-x86_64-linux-gnu-cpu.tar.gz tar -xzvf xla_extension-x86_64-linux-gnu-cpu.tar.gz - uses: actions-rs/cargo@v1 with: @@ -39,7 +39,7 @@ jobs: toolchain: ${{ matrix.rust }} override: true - run: | - wget -nv https://github.com/elixir-nx/xla/releases/download/v0.5.1/xla_extension-x86_64-linux-gnu-cpu.tar.gz + wget -nv https://github.com/elixir-nx/xla/releases/download/v0.7.0/xla_extension-x86_64-linux-gnu-cpu.tar.gz tar -xzvf xla_extension-x86_64-linux-gnu-cpu.tar.gz - uses: actions-rs/cargo@v1 with: @@ -73,7 +73,7 @@ jobs: override: true - run: rustup component add clippy - run: | - wget -nv https://github.com/elixir-nx/xla/releases/download/v0.5.1/xla_extension-x86_64-linux-gnu-cpu.tar.gz + wget -nv https://github.com/elixir-nx/xla/releases/download/v0.7.0/xla_extension-x86_64-linux-gnu-cpu.tar.gz tar -xzvf xla_extension-x86_64-linux-gnu-cpu.tar.gz - uses: actions-rs/cargo@v1 with: diff --git a/Cargo.toml b/Cargo.toml index 778aa25..6f4e241 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xla" -version = "0.1.6" +version = "0.2.0" authors = ["laurent "] edition = "2021" description = "Bindings for the XLA C++ library." diff --git a/README.md b/README.md index 60f6055..0db0f7f 100644 --- a/README.md +++ b/README.md @@ -2,14 +2,14 @@ Experimentation using the xla compiler from rust Pre-compiled binaries for the xla library can be downloaded from the -[elixir-nx/xla repo](https://github.com/elixir-nx/xla/releases/tag/v0.6.0). +[elixir-nx/xla repo](https://github.com/elixir-nx/xla/releases/tag/v0.7.0). These should be extracted at the root of this repository, resulting in a `xla_extension` subdirectory being created, the currently supported version -is 0.6.0. +is 0.7.0. For a linux platform, this can be done via: ```bash -wget https://github.com/elixir-nx/xla/releases/download/v0.6.0/xla_extension-x86_64-linux-gnu-cpu.tar.gz +wget https://github.com/elixir-nx/xla/releases/download/v0.7.0/xla_extension-x86_64-linux-gnu-cpu.tar.gz tar -xzvf xla_extension-x86_64-linux-gnu-cpu.tar.gz ``` diff --git a/xla_rs/xla_rs.cc b/xla_rs/xla_rs.cc index 99cbabe..3f3c8dd 100644 --- a/xla_rs/xla_rs.cc +++ b/xla_rs/xla_rs.cc @@ -42,8 +42,9 @@ status pjrt_gpu_client_create(pjrt_client *output, double memory_fraction, bool preallocate) { xla::GpuAllocatorConfig allocator = {.memory_fraction = memory_fraction, .preallocate = preallocate}; - ASSIGN_OR_RETURN_STATUS( - client, xla::GetStreamExecutorGpuClient(false, allocator, 0, 0)); + xla::GpuClientOptions options; + options.allocator_config = allocator; + ASSIGN_OR_RETURN_STATUS(client, xla::GetStreamExecutorGpuClient(options)); *output = new std::shared_ptr(std::move(client)); return nullptr; } From 8b199b8d195680d0daa7b8e1af9c1ebfa8c08f0b Mon Sep 17 00:00:00 2001 From: laurent Date: Thu, 13 Jun 2024 15:33:48 +0200 Subject: [PATCH 2/3] Remove flag. --- build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.rs b/build.rs index 9094064..769a3c6 100644 --- a/build.rs +++ b/build.rs @@ -80,7 +80,7 @@ fn main() { // "DSO missing from command line" error // undefined reference to symbol '_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE@@GLIBCXX_3.4.21' if os == OS::Linux { - println!("cargo:rustc-link-arg=-Wl,--copy-dt-needed-entries"); + // println!("cargo:rustc-link-arg=-Wl,--copy-dt-needed-entries"); println!("cargo:rustc-link-arg=-Wl,-lstdc++"); } println!("cargo:rustc-link-search=native={}", xla_dir.join("lib").display()); From 2a57656dfbb65d502f8c2a079eeab2c8cd35bad5 Mon Sep 17 00:00:00 2001 From: laurent Date: Thu, 13 Jun 2024 15:37:01 +0200 Subject: [PATCH 3/3] Fix lint. --- build.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/build.rs b/build.rs index 769a3c6..7e66a45 100644 --- a/build.rs +++ b/build.rs @@ -6,6 +6,7 @@ use std::path::{Path, PathBuf}; #[derive(Clone, Copy, Eq, PartialEq)] enum OS { Linux, + #[allow(clippy::enum_variant_names)] MacOS, Windows, }