Skip to content

Commit 9e7a7ac

Browse files
committed
code review
1 parent f9dc9be commit 9e7a7ac

3 files changed

Lines changed: 11 additions & 27 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ jobs:
1717
test:
1818
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
1919
runs-on: ${{ matrix.os }}
20-
# a native library that aborts or deadlocks otherwise wedges the runner for the full
21-
# 6h default; the slowest passing job takes about 45 minutes
2220
timeout-minutes: 90
2321
strategy:
2422
fail-fast: false

‎ext/TensorOperationsTBLISExt.jl‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ using TensorOperations: tensoralloc_add, tensorfree!
1313
using TBLIS
1414
using TBLIS: len_type, stride_type, tblis_tensor
1515

16+
using LinearAlgebra.BLAS: BlasFloat
1617
const SV = StridedView
1718

18-
const TBLISFloat = Union{Float32, Float64, ComplexF32, ComplexF64}
19+
const TBLISFloat = BlasFloat
1920

2021
# `tblis_jll` does ship a Windows build, but it aborts the process with
2122
# "posix_memalign: Invalid argument" from `tblis::MemoryPool::acquire` as soon as a

‎src/backends.jl‎

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -76,35 +76,20 @@ const StridedBackend = Union{StridedNative, StridedBLAS}
7676
"""
7777
TBLISBackend()
7878
79-
Backend for tensor operations on strided arrays that is based on the
80-
[TBLIS](https://github.com/devinamatthews/tblis) library.
81-
TBLIS performs tensor additions, traces and contractions directly on strided memory, without
82-
the transpositions and temporaries that a BLAS-based approach requires.
83-
This backend is only available through a package extension for
84-
[TBLIS.jl](https://github.com/QuantumKitHub/TBLIS.jl).
85-
86-
TBLIS requires all tensors in a single operation to share one element type, which moreover
87-
has to be one of `Float32`, `Float64`, `ComplexF32` or `ComplexF64`.
88-
Arguments that do not meet these requirements, including non-strided arrays, are rejected
89-
with an `ArgumentError` rather than passed on to another backend.
79+
Backend for tensor operations on strided arrays that is based on the [TBLIS](https://github.com/devinamatthews/tblis) library.
80+
TBLIS performs tensor additions, traces and contractions directly on strided memory, without the transpositions and temporaries that a BLAS-based approach requires.
81+
This backend is only available through a package extension for [TBLIS.jl](https://github.com/QuantumKitHub/TBLIS.jl).
9082
91-
!!! warning
92-
This backend is not supported on Windows: the `tblis_jll` binaries for that platform
93-
abort the process from inside the library, so calls are rejected with an
94-
`ArgumentError` there as well.
83+
TBLIS requires all tensors in a single operation to be of the same element type, and only supports `BLASFloat`s.
9584
96-
!!! note
97-
Contracting in place trades throughput for memory.
98-
On a 16-core node this backend is roughly on par with
99-
[`StridedBLAS`](@ref TensorOperations.StridedBLAS) for permuted real contractions and
100-
slower for other shapes, but it allocates no permuted temporaries at all.
85+
!!! warning
86+
This backend is currently not supported on Windows: the `tblis_jll` binaries for that platform
87+
abort the process from inside the library, so calls are rejected with an `ArgumentError`.
10188
10289
!!! warning
10390
As of `tblis_jll` v1.3, TBLIS has no competitive support for complex element types: its
104-
complex contraction kernels run an order of magnitude slower than the corresponding BLAS
105-
calls.
106-
Prefer [`StridedBLAS`](@ref TensorOperations.StridedBLAS) for complex-valued
107-
contractions.
91+
complex contraction kernels run an order of magnitude slower than the corresponding BLAS calls.
92+
Prefer [`StridedBLAS`](@ref TensorOperations.StridedBLAS) for complex-valued contractions.
10893
"""
10994
struct TBLISBackend <: AbstractBackend end
11095

0 commit comments

Comments
 (0)