Skip to content

Commit b9f5c67

Browse files
mooskaghPikaCat-OuO
authored andcommitted
XLA backend for Lc0 (LeelaChessZero#1949)
(cherry picked from commit 04f73fc)
1 parent 4de5b99 commit b9f5c67

16 files changed

+5375
-0
lines changed

meson.build

+16
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,22 @@ if get_option('build_backends')
623623
endif
624624

625625

626+
## ~~~~~~~~
627+
## XLA
628+
## ~~~~~~~~
629+
if get_option('xla')
630+
files += [
631+
'src/neural/xla/hlo_builder.cc',
632+
'src/neural/xla/network_xla.cc',
633+
'src/neural/xla/onnx2hlo.cc',
634+
'src/neural/xla/print_hlo.cc',
635+
'src/neural/xla/pjrt.cc',
636+
'src/neural/xla/xla_runner.cc',
637+
]
638+
files += gen_proto_src.process('src/neural/xla/hlo.proto',
639+
preserve_path_from : meson.current_source_dir() + '/src/')
640+
deps += cc.find_library('dl', required: false)
641+
endif
626642

627643
endif # if get_option('build_backends')
628644

meson_options.txt

+5
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,8 @@ option('onnx_include',
187187
type: 'string',
188188
value: 'D:/IDE/Microsoft Visual Studio/Projects/lc0/subprojects/onnx/include',
189189
description: 'Paths to ONNX runtime includes')
190+
191+
option('xla',
192+
type: 'boolean',
193+
value: false,
194+
description: 'Enable XLA backend')

scripts/compile_proto.py

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
'package',
6565
'message',
6666
'optional',
67+
'required',
6768
'repeated',
6869
'enum',
6970
] + list(TYPES.keys())

0 commit comments

Comments
 (0)