Skip to content

Commit

Permalink
Use general OS options instead of linux specific
Browse files Browse the repository at this point in the history
  • Loading branch information
cgbur committed Aug 3, 2023
1 parent 2dc9163 commit 631d596
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ pub fn main() !void {
// mmap the checkpoint to directly map the weights
const mapped_checkpoint = try (std.fs.cwd().openFile(bin_path, .{}));
defer mapped_checkpoint.close();
const data: []align(mem.page_size) u8 = try std.os.mmap(null, file_size, std.os.linux.PROT.READ, std.os.linux.MAP.PRIVATE, mapped_checkpoint.handle, 0);
const data: []align(mem.page_size) u8 = try std.os.mmap(null, file_size, std.os.PROT.READ, std.os.MAP.PRIVATE, mapped_checkpoint.handle, 0);
defer std.os.munmap(data);
const weights = Weights.init(&config, data[@sizeOf(ConfigReader)..], shared_weights);

Expand Down

1 comment on commit 631d596

@twobob
Copy link

@twobob twobob commented on 631d596 Aug 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

llama2.zig> c:\zig\zig build -Doptimize=ReleaseFast
zig build-exe llama2 ReleaseFast native: error: the following command failed with 1 compilation errors:
c:\zig\zig.exe build-exe C:!DEV\eh\qlora\llama2.zig\src\main.zig -fstrip -OReleaseFast --cache-dir C:!DEV\eh\qlora\llama2.zig\zig-cache --global-cache-dir C:\Users\eh\AppData\Local\zig --name llama2 --listen=-
Build Summary: 0/3 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
└─ install llama2 transitive failure
└─ zig build-exe llama2 ReleaseFast native 1 errors
c:\zig\lib\std\os.zig:99:23: error: root struct of file 'c' has no member named 'MAP'
pub const MAP = system.MAP;

just so you know. reported in a relevant issue as well

Please sign in to comment.