Skip to content

Commit

Permalink
Merge pull request #17 from LaurentMazare/0.7.0
Browse files Browse the repository at this point in the history
Update for 0.7.0.
  • Loading branch information
LaurentMazare committed Jun 13, 2024
2 parents d3ad0c9 + 2a57656 commit bf5ec7e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xla"
version = "0.1.6"
version = "0.2.0"
authors = ["laurent <[email protected]>"]
edition = "2021"
description = "Bindings for the XLA C++ library."
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
3 changes: 2 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use std::path::{Path, PathBuf};
#[derive(Clone, Copy, Eq, PartialEq)]
enum OS {
Linux,
#[allow(clippy::enum_variant_names)]
MacOS,
Windows,
}
Expand Down Expand Up @@ -80,7 +81,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());
Expand Down
5 changes: 3 additions & 2 deletions xla_rs/xla_rs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit bf5ec7e

Please sign in to comment.