Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Implement wrappers for WMMA LLVM intrinsics #494

Merged
merged 91 commits into from
Feb 3, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
7561da6
Implement wrappers for WMMA LLVM intrinsics
thomasfaingnaert Nov 9, 2019
8f4f2d1
Implement basic CUDA-style API
thomasfaingnaert Nov 10, 2019
23d9552
Generalise load for matrix
thomasfaingnaert Nov 10, 2019
faae545
Implement wrappers for WMMA LLVM intrinsics
thomasfaingnaert Nov 9, 2019
0efeaaa
Merge branch 'wmma-wrapper' into wmma-cuda
thomasfaingnaert Nov 10, 2019
844f28e
Move high-level API to same file
thomasfaingnaert Nov 10, 2019
91d6ee7
Finish load
thomasfaingnaert Nov 10, 2019
db17cc6
Wrapper for store
thomasfaingnaert Nov 10, 2019
53657fe
Generalise MMA
thomasfaingnaert Nov 10, 2019
7a0b1dc
Generalise high level test
thomasfaingnaert Nov 10, 2019
d0e490c
Move d type to config
thomasfaingnaert Nov 10, 2019
7ec4877
Add fill_fragment function
thomasfaingnaert Nov 10, 2019
cf3ba19
Add tests for multiply
thomasfaingnaert Nov 10, 2019
740559a
Add configuration variable to fill
thomasfaingnaert Nov 10, 2019
44898c6
Add documentation
thomasfaingnaert Nov 10, 2019
cb753da
Add documentation
thomasfaingnaert Nov 10, 2019
c43a50c
Merge branch 'wmma-wrapper' into wmma-cuda
thomasfaingnaert Nov 10, 2019
381e25a
Add initial documentation CUDA style API
thomasfaingnaert Nov 10, 2019
3ed3a17
Finalise documentation
thomasfaingnaert Nov 11, 2019
722cb5a
Merge remote-tracking branch 'upstream/master' into wmma-wrapper
thomasfaingnaert Nov 14, 2019
18394c1
Implement tests for shared address space
thomasfaingnaert Nov 15, 2019
0b8fff8
Change default shared memory alignment
thomasfaingnaert Nov 23, 2019
3d22453
Merge branch 'wmma-wrapper' into wmma-cuda
thomasfaingnaert Nov 23, 2019
410a12b
Change equality test
thomasfaingnaert Nov 25, 2019
67fbbf7
Merge branch 'wmma-wrapper' into wmma-cuda
thomasfaingnaert Nov 25, 2019
ab54af0
Change equality test
thomasfaingnaert Nov 25, 2019
f44388a
Change load to ccall
thomasfaingnaert Nov 26, 2019
b1865dd
Use ccall for store
thomasfaingnaert Nov 26, 2019
865aac5
Cleanup store
thomasfaingnaert Nov 27, 2019
4e2cb3c
Fix wmma
thomasfaingnaert Nov 27, 2019
c85e4d5
Fix shared tests
thomasfaingnaert Nov 27, 2019
84f43f0
Clean up wrappers
thomasfaingnaert Nov 27, 2019
6b6e65b
Fix indenting
thomasfaingnaert Nov 27, 2019
2455e3b
Fix typo
thomasfaingnaert Nov 27, 2019
4d39b9b
Fix typo
thomasfaingnaert Nov 27, 2019
579a060
Cleanup addrspacecast
thomasfaingnaert Nov 27, 2019
5606368
Re-enable tests
thomasfaingnaert Nov 27, 2019
fc108a6
Fix intrinsics for LLVM 8
thomasfaingnaert Nov 28, 2019
3c16a20
Fix shared tests
thomasfaingnaert Nov 28, 2019
2d2b592
Clean up tests
thomasfaingnaert Nov 28, 2019
b8de94b
Merge branch 'wmma-cuda' into wmma-wrapper
thomasfaingnaert Nov 28, 2019
2d0c7cf
Fixes
thomasfaingnaert Nov 28, 2019
9373c55
Reenable tests
thomasfaingnaert Nov 28, 2019
ba6ff5b
Add whitespace
thomasfaingnaert Nov 29, 2019
06f1f1e
Use separate frag size variable for high-level API
thomasfaingnaert Nov 29, 2019
f5ebc8e
Implement flattening
thomasfaingnaert Nov 29, 2019
08a6e6c
Test elementwise op
thomasfaingnaert Nov 29, 2019
05ec4a5
Change comment
thomasfaingnaert Nov 29, 2019
a83bbfa
Only run WMMA test for recent Julia
thomasfaingnaert Nov 30, 2019
062038d
Reenable other tests
thomasfaingnaert Nov 30, 2019
62607ef
Add minimum Julia version to documentation
thomasfaingnaert Nov 30, 2019
df1ca7d
Refactor load to use @generated
thomasfaingnaert Dec 1, 2019
9fd6b74
Refactor store to use @generated
thomasfaingnaert Dec 1, 2019
c7eef61
Refactor fill to use @generated
thomasfaingnaert Dec 1, 2019
0d6777c
Refactor wmma to use @generated
thomasfaingnaert Dec 1, 2019
702d372
Cleanup
thomasfaingnaert Dec 1, 2019
9a3036c
Reenable tests
thomasfaingnaert Dec 1, 2019
e4fe143
Implement broadcasting
thomasfaingnaert Dec 2, 2019
556bbdf
Use correct type for alpha and beta
thomasfaingnaert Dec 3, 2019
40ff035
Add tests for flattening and unflattening
thomasfaingnaert Dec 4, 2019
3911871
Add tests for broadcasting
thomasfaingnaert Dec 4, 2019
70f35df
Add CUDAnative prefix
thomasfaingnaert Dec 4, 2019
c99d9f6
Adhere to Julia naming convention for types
thomasfaingnaert Dec 6, 2019
765a7c2
Capitalise WMMA
thomasfaingnaert Dec 6, 2019
10828dc
Merge remote-tracking branch 'upstream/master' into wmma-wrapper
thomasfaingnaert Dec 7, 2019
e5e6965
Move examples to separate folder
thomasfaingnaert Dec 7, 2019
76ed2bb
Only run WMMA examples for recent Julia
thomasfaingnaert Dec 7, 2019
eff97ae
Merge remote-tracking branch 'upstream/master' into wmma-wrapper
thomasfaingnaert Dec 10, 2019
e181320
Undo changes to Project and Manifest file
thomasfaingnaert Dec 10, 2019
841199e
Document flattening and broadcast
thomasfaingnaert Dec 10, 2019
86af328
Bump minimum Julia version
thomasfaingnaert Dec 10, 2019
6d376f3
Use exit() in examples
thomasfaingnaert Dec 10, 2019
c50beed
Temporarily disable test
thomasfaingnaert Dec 10, 2019
1b70c90
Bump min SM for Julia nightly tests
thomasfaingnaert Dec 12, 2019
0563679
Check capability in WMMA tests
thomasfaingnaert Dec 12, 2019
3b8391d
Reenable unflatten test
thomasfaingnaert Dec 15, 2019
a64194d
Merge remote-tracking branch 'upstream/master' into wmma-wrapper
thomasfaingnaert Dec 26, 2019
fdc8dde
Update version check
thomasfaingnaert Dec 26, 2019
b869380
Merge remote-tracking branch 'upstream/master' into wmma-wrapper
thomasfaingnaert Jan 31, 2020
3f9faac
Set CI_THOROUGH
thomasfaingnaert Jan 31, 2020
a1b64f2
Mark constants as 'const'
thomasfaingnaert Jan 31, 2020
d215a56
Remove join_nonempty
thomasfaingnaert Jan 31, 2020
d66f738
Implement indexing for WMMAFragment
thomasfaingnaert Jan 31, 2020
dad2a66
Refactor conversion of AS to Int
thomasfaingnaert Jan 31, 2020
28f44b5
Move LLVM instrincs doc to docstrings
thomasfaingnaert Jan 31, 2020
9d9d5e2
Fix path to examples in docs
thomasfaingnaert Jan 31, 2020
ae19e03
Move everything in WMMA submodule
thomasfaingnaert Feb 1, 2020
3c95dcf
Fix docs
thomasfaingnaert Feb 1, 2020
94ab442
Fix indenting
thomasfaingnaert Feb 1, 2020
3579373
Add broadcasting to example
thomasfaingnaert Feb 1, 2020
93c77bc
Small doc fix
thomasfaingnaert Feb 1, 2020
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
Prev Previous commit
Next Next commit
Move d type to config
  • Loading branch information
thomasfaingnaert committed Nov 10, 2019
commit d0e490c3e63e9191ce457a2934e95ac97927597e
8 changes: 4 additions & 4 deletions src/device/cuda/wmma.jl
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ end
# ------------------

export wmma_config
struct wmma_config{M, N, K} end
struct wmma_config{M, N, K, d_type} end

# ---------
# Constants
Expand Down Expand Up @@ -353,7 +353,7 @@ for mat in ["a", "b", "c"],
@eval function $func_name(addr::DevicePtr{$ptr_ty, $as_ty},
stride::Number,
layout::Type{$layout_ty},
config::Type{wmma_config{16, 16, 16}})
config::Type{wmma_config{16, 16, 16, d_type}}) where d_type
x = $wrapper(addr, stride)
return wmma_fragment{16, 16, 16, $frag_sz, $julia_type, $layout_frag_ty, $matrix_use}(x)
end
Expand Down Expand Up @@ -402,7 +402,7 @@ for a_layout in ["col", "row"],
@eval function wmma_mma(a::wmma_fragment{16, 16, 16, $a_frag_sz, $a_julia_type, $a_layout_ty, wmma_matrix_a},
b::wmma_fragment{16, 16, 16, $b_frag_sz, $b_julia_type, $b_layout_ty, wmma_matrix_b},
c::wmma_fragment{16, 16, 16, $c_frag_sz, $c_julia_type, wmma_unspecified, wmma_accumulator},
d_type::Type{$dispatch_ty})
conf::Type{wmma_config{16, 16, 16, $dispatch_ty}})
x = $wrapper(a.x, b.x, c.x)
return wmma_fragment{16, 16, 16, $d_frag_sz, $d_julia_type, wmma_unspecified, wmma_accumulator}(x)
end
Expand Down Expand Up @@ -451,7 +451,7 @@ for mat in ["d"],
d::wmma_fragment{16, 16, 16, $frag_sz, $julia_type, $layout_frag_ty, $matrix_use},
stride::Number,
layout::Type{$layout_ty},
config::Type{wmma_config{16, 16, 16}})
config::Type{wmma_config{16, 16, 16, d_type}}) where d_type
$wrapper(addr, d.x, stride)
return nothing
end
Expand Down
4 changes: 2 additions & 2 deletions test/device/wmma.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@
d_dev = CuArray(d)

@eval function kernel(a_dev, b_dev, c_dev, d_dev)
conf = wmma_config{16, 16, 16}
conf = wmma_config{16, 16, 16, $d_type}

a_frag = wmma_load_a(pointer(a_dev), 16, $a_layout, conf)
b_frag = wmma_load_b(pointer(b_dev), 16, $b_layout, conf)
c_frag = wmma_load_c(pointer(c_dev), 16, $c_layout, conf)

d_frag = wmma_mma(a_frag, b_frag, c_frag, $d_type)
d_frag = wmma_mma(a_frag, b_frag, c_frag, conf)

wmma_store_d(pointer(d_dev), d_frag, 16, $d_layout, conf)

Expand Down