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

XLA backend for Lc0 #1949

Merged
merged 49 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
f3758c5
Add hlo.proto
mooskagh Feb 4, 2024
d3eb196
Skeleton.
mooskagh Feb 4, 2024
9db9779
Compiles checkpoint.
mooskagh Feb 4, 2024
11a48ac
Compiles. Checkpoint.
mooskagh Feb 4, 2024
61f0944
Compiles.
mooskagh Feb 4, 2024
8fbd6f2
Checkpoint.
mooskagh Feb 5, 2024
2ecbd68
List devices
mooskagh Feb 6, 2024
9eb56e7
Device list works, reached the compilation stage.
mooskagh Feb 6, 2024
824b9a9
Attempts to compile!
mooskagh Feb 7, 2024
181c872
Minimal HLO is built.
mooskagh Feb 9, 2024
8023aa1
Pretty printer
mooskagh Feb 10, 2024
42e0dae
The HLO compiles! \o/
mooskagh Feb 10, 2024
4da62a1
Constants are supported.
mooskagh Feb 10, 2024
9f03b7d
Parameter index fix.
mooskagh Feb 10, 2024
da11fd8
Compiler is happy about my constant!
mooskagh Feb 10, 2024
242b363
Correct context restoration
mooskagh Feb 10, 2024
eae5722
Convolution params pretty printing.
mooskagh Feb 10, 2024
d344233
Convolution works including bias
mooskagh Feb 11, 2024
4fc2836
Relu implemented.
mooskagh Feb 11, 2024
fdc858c
Add (with implicit broadcast!) implemented!
mooskagh Feb 11, 2024
47c3ad9
Reshape works but doesn't reset the layout
mooskagh Feb 11, 2024
79b1e8d
MatMul! \o/
mooskagh Feb 11, 2024
eaae09d
OMG the entre 11248.pb.gz graph is converted.
mooskagh Feb 11, 2024
9c81247
outputs are also supported
mooskagh Feb 11, 2024
3f77a2b
Buffers are half-way to GPU
mooskagh Feb 12, 2024
c998407
A comment.
mooskagh Feb 14, 2024
37ade1e
Removed abstract classes.
mooskagh Feb 14, 2024
17d836c
Data goes to GPU
mooskagh Feb 15, 2024
b00e990
Initialized backend! \o/
mooskagh Feb 15, 2024
6c43647
Filled InputPlanes
mooskagh Feb 15, 2024
0b67f81
It executes something!
mooskagh Feb 15, 2024
bace9a8
Buffers are on the host, but not yet at MCTS
mooskagh Feb 15, 2024
f25e56d
Done but crashes. :-P
mooskagh Feb 15, 2024
ffcaeca
Runs end to end!
mooskagh Feb 17, 2024
fe3edee
Cleanup memory before filling the position.
mooskagh Feb 17, 2024
90ea194
Works. :tada: \o/
mooskagh Feb 17, 2024
abc9596
Configurable PjRt plugin path.
mooskagh Feb 17, 2024
dd34c7e
Parellel NN outputs transfer. And non-hardcoded PjRt plugin path
mooskagh Feb 21, 2024
ad6063a
Configurable batch size.
mooskagh Feb 21, 2024
c7218e6
Cleanup
mooskagh Feb 21, 2024
a339452
Hlo Builder cleanup.
mooskagh Feb 22, 2024
12c2074
onnx2hlo comments
mooskagh Feb 22, 2024
27fafca
Allow GPU selection
mooskagh Feb 23, 2024
15cb362
xla_runner cleanup
mooskagh Feb 23, 2024
6ab1cf6
More cleanup
mooskagh Feb 23, 2024
f66234c
netword_xla cleanup
mooskagh Feb 23, 2024
4ded400
Commment the print_hlo
mooskagh Feb 23, 2024
2c08ec7
Adding libdl as a dep when building with XLA backend.
mooskagh Feb 24, 2024
25f3544
Merge remote-tracking branch 'upstream/master' into xla
mooskagh Feb 24, 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
16 changes: 16 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,22 @@ if get_option('build_backends')
endif


## ~~~~~~~~
## XLA
## ~~~~~~~~
if get_option('xla')
files += [
'src/neural/xla/hlo_builder.cc',
'src/neural/xla/network_xla.cc',
'src/neural/xla/onnx2hlo.cc',
'src/neural/xla/print_hlo.cc',
'src/neural/xla/pjrt.cc',
'src/neural/xla/xla_runner.cc',
]
files += gen_proto_src.process('src/neural/xla/hlo.proto',
preserve_path_from : meson.current_source_dir() + '/src/')
deps += cc.find_library('dl', required: false)
endif

endif # if get_option('build_backends')

Expand Down
5 changes: 5 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,8 @@ option('onnx_include',
type: 'string',
value: '',
description: 'Paths to ONNX runtime includes')

option('xla',
type: 'boolean',
value: false,
description: 'Enable XLA backend')
1 change: 1 addition & 0 deletions scripts/compile_proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
'package',
'message',
'optional',
'required',
'repeated',
'enum',
] + list(TYPES.keys())
Expand Down
Loading