Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ ds4_agent_cpu.o: ds4_agent.c ds4.h ds4_ssd.h ds4_distributed.h ds4_help.h ds4_kv
ds4_metal.o: ds4_metal.m ds4_gpu.h $(METAL_SRCS)
$(CC) $(OBJCFLAGS) -c -o $@ ds4_metal.m

ds4_cuda.o: ds4_cuda.cu ds4_gpu.h ds4_iq2_tables_cuda.inc
ds4_cuda.o: ds4_cuda.cu ds4_gpu.h ds4_iq2_tables_cuda.inc ds4_cuda_gqa.inc \
ds4_cuda_glm_kv.inc ds4_cuda_glm_indexer.inc ds4_cuda_glm_attn.inc \
ds4_cuda_glm_moe.inc ds4_cuda_glm_stubs.inc
$(NVCC) $(NVCCFLAGS) -c -o $@ ds4_cuda.cu

ds4_rocm.o: ds4_rocm.cu ds4_gpu.h ds4_iq2_tables_cuda.inc $(ROCM_SRCS)
Expand Down
870 changes: 851 additions & 19 deletions ds4.c

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions ds4_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -1937,6 +1937,19 @@ static cli_config parse_options(int argc, char **argv) {
}

int main(int argc, char **argv) {
/* Kernel self-tests that need no model file; handled before option
* parsing so no other flags are required. */
for (int i = 1; i < argc; i++) {
if (!strcmp(argv[i], "--gqa-selftest")) {
#ifndef DS4_NO_GPU
extern int ds4_gpu_gqa_selftest(void);
return ds4_gpu_gqa_selftest() ? 0 : 1;
#else
fprintf(stderr, "ds4: --gqa-selftest requires a GPU build\n");
return 2;
#endif
}
}
cli_config cfg = parse_options(argc, argv);
if (cfg.gen.dump_tokens) {
if (cfg.gen.prompt == NULL) {
Expand Down
1,797 changes: 1,627 additions & 170 deletions ds4_cuda.cu

Large diffs are not rendered by default.

Loading