-
Notifications
You must be signed in to change notification settings - Fork 83
Experimental build.zig #262
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
base: master
Are you sure you want to change the base?
Conversation
@@ -450,7 +427,9 @@ fn testSetIdx(val: usize) void { | |||
} | |||
|
|||
fn testFn() void { | |||
std.debug.assert(remainingStackSize() > 2048); | |||
// Check if the stack was already overflowed | |||
const current = xframe(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Corendos not sure what this test is doing but it's not compiling anymore.
@@ -18,10 +18,10 @@ pub const log = std.log.scoped(.@"zml/aio"); | |||
test { | |||
std.testing.refAllDecls(@This()); | |||
std.testing.refAllDecls(gguf); | |||
std.testing.refAllDecls(nemo); | |||
// std.testing.refAllDecls(nemo); | |||
std.testing.refAllDecls(safetensors); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't ported the yaml deps to build.zig, but also not sure it's worth it. The nemo/yaml code doesn't compile anyway.
@@ -25,7 +25,6 @@ zig_library( | |||
visibility = ["//visibility:public"], | |||
deps = [ | |||
":posix", | |||
":sentencepiece_model_proto", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasn't used
@@ -35,9 +34,7 @@ zig_library( | |||
"//stdx", | |||
"//zml/tokenizer", | |||
"//zml/tools", | |||
"@rules_zig//zig/lib:libc", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wasn't used
9c591b3
to
d09a6a5
Compare
fixup! add "zml_sandbox"
57364d0
to
7be70e8
Compare
7be70e8
to
dfd92dd
Compare
!!! This build.zig is experimental !!!
#67
It shows how to bridge Bazel and build.zig.
It requires the user to have
bazel
andtar
installed on their machine.Bazel is used to:
build.zig finishes the work by:
zig build test --summary all
will run a lot of testszig build test-zml
will stick to ZML test suitezig build -Druntimes:cpu=true -Druntimes:cuda=false test
will enable/disable runtimesCaveats:
ziglang/zig@8eb5813
this works around zig fetch: Erroneous
FileBusy
error if package tarball's paths are prefixed with./
ziglang/zig#23152Potential follow ups:
The main missing is that Bazel takes care of sandboxing
ZML executables and the PJRT runtimes and all the dependencies.
This part has not been added to build.zig beyond mininal rPath for the the libpjrt_xxx.so,
but for cuda you have more depedencies that would need to be sandboxed.
The module graph of the various protobuffers is alson a bit big,
and if it changes it will be tedious to update. Ideally bazel should generate this graph of deps for us.