Skip to content

Commit

Permalink
XLA backend for Lc0 (LeelaChessZero#1949)
Browse files Browse the repository at this point in the history
(cherry picked from commit 04f73fc)
  • Loading branch information
mooskagh authored and PikaCat-OuO committed Mar 19, 2024
1 parent 4de5b99 commit b9f5c67
Show file tree
Hide file tree
Showing 16 changed files with 5,375 additions and 0 deletions.
16 changes: 16 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,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: 'D:/IDE/Microsoft Visual Studio/Projects/lc0/subprojects/onnx/include',
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

0 comments on commit b9f5c67

Please sign in to comment.