@@ -272,6 +272,7 @@ struct cmd_params {
272272 bool muge = false ;
273273 bool rcache = false ;
274274 bool sas = false ;
275+ int fdn = 0 ; // fdn = fused delta net
275276 bool print_overrides = false ;
276277 output_formats output_format;
277278 output_formats output_format_stderr;
@@ -318,6 +319,7 @@ static const cmd_params cmd_params_defaults = {
318319 /* muge */ false ,
319320 /* rcache */ false ,
320321 /* sas */ false ,
322+ /* fdn */ 0 ,
321323 /* print_overrides */ false ,
322324 /* output_format */ MARKDOWN ,
323325 /* output_format_stderr */ NONE ,
@@ -372,6 +374,7 @@ static void print_usage(int /* argc */, char ** argv) {
372374 printf (" -no-fug, --no-fused-up-gate <0|1> (default: %s)\n " , cmd_params_defaults.no_fug ? " 1" : " 0" );
373375 printf (" -no-ooae, --no-offload-only-active-experts <0|1> (default: %s)\n " , cmd_params_defaults.no_ooae ? " 1" : " 0" );
374376 printf (" -sas, --scheduler-async <0|1> (default: %s)\n " , cmd_params_defaults.sas ? " 1" : " 0" );
377+ printf (" -fdn, --fused-delta-net <n> (default: %d)\n " , cmd_params_defaults.fdn );
375378 printf (" --print-overrides <0|1> (default: %s)\n " , cmd_params_defaults.print_overrides ? " 1" : " 0" );
376379 printf (" \n " );
377380 printf (" Multiple values can be given for each parameter by separating them with ',' or by specifying the parameter multiple times.\n " );
@@ -820,6 +823,12 @@ static cmd_params parse_cmd_params(int argc, char ** argv) {
820823 break ;
821824 }
822825 params.sas = std::stoi (argv[i]);
826+ } else if (arg == " -fdn" || arg == " --fused-delta-net" ) {
827+ if (++i >= argc) {
828+ invalid_param = true ;
829+ break ;
830+ }
831+ params.fdn = std::stoi (argv[i]);
823832 } else if (arg == " -rcache" || arg == " --rope-cache" ) {
824833 if (++i >= argc) {
825834 invalid_param = true ;
@@ -968,6 +977,7 @@ struct cmd_params_instance {
968977 bool muge = false ;
969978 bool rcache = false ;
970979 bool sas = false ;
980+ int fdn = 0 ;
971981 const llama_model_tensor_buft_override* buft_overrides;
972982
973983 llama_model_params to_llama_mparams () const {
@@ -1004,6 +1014,8 @@ struct cmd_params_instance {
10041014 mqkv == other.mqkv &&
10051015 muge == other.muge &&
10061016 use_thp == other.use_thp &&
1017+ sas == other.sas &&
1018+ fdn == other.fdn &&
10071019 tensor_split == other.tensor_split ;
10081020 }
10091021
@@ -1030,6 +1042,7 @@ struct cmd_params_instance {
10301042 cparams.embeddings = embeddings;
10311043 cparams.cuda_params = (void *)cuda_params.data ();
10321044 cparams.scheduler_async = sas;
1045+ cparams.fused_delta_net = fdn;
10331046
10341047 return cparams;
10351048 }
@@ -1098,6 +1111,7 @@ static std::vector<cmd_params_instance> get_cmd_params_instances(const cmd_param
10981111 /* .muge = */ params.muge ,
10991112 /* .rcache = */ params.rcache ,
11001113 /* .sas = */ params.sas ,
1114+ /* .fdn = */ params.fdn ,
11011115 /* .buft_overrides=*/ params.buft_overrides .data (),
11021116 };
11031117 instances.push_back (instance);
@@ -1142,6 +1156,7 @@ static std::vector<cmd_params_instance> get_cmd_params_instances(const cmd_param
11421156 /* .muge = */ params.muge ,
11431157 /* .rcache = */ params.rcache ,
11441158 /* .sas = */ params.sas ,
1159+ /* .fdn = */ params.fdn ,
11451160 /* .buft_overrides=*/ params.buft_overrides .data (),
11461161 };
11471162 instances.push_back (instance);
@@ -1186,6 +1201,7 @@ static std::vector<cmd_params_instance> get_cmd_params_instances(const cmd_param
11861201 /* .muge = */ params.muge ,
11871202 /* .rcache = */ params.rcache ,
11881203 /* .sas = */ params.sas ,
1204+ /* .fdn = */ params.fdn ,
11891205 /* .buft_overrides=*/ params.buft_overrides .data (),
11901206 };
11911207 instances.push_back (instance);
@@ -1230,6 +1246,7 @@ static std::vector<cmd_params_instance> get_cmd_params_instances(const cmd_param
12301246 /* .muge = */ params.muge ,
12311247 /* .rcache = */ params.rcache ,
12321248 /* .sas = */ params.sas ,
1249+ /* .fdn = */ params.fdn ,
12331250 /* .buft_overrides=*/ params.buft_overrides .data (),
12341251 };
12351252 instances.push_back (instance);
@@ -1285,6 +1302,7 @@ struct test {
12851302 bool muge = false ;
12861303 bool rcache = false ;
12871304 bool sas = false ;
1305+ int fdn = 0 ;
12881306 std::string override_tensor;
12891307 int n_prompt;
12901308 int n_gen;
@@ -1327,6 +1345,7 @@ struct test {
13271345 ger = inst.ger ;
13281346 rcache = inst.rcache ;
13291347 sas = inst.sas ;
1348+ fdn = inst.fdn ;
13301349 no_fug = inst.no_fug ;
13311350 use_thp = inst.use_thp ;
13321351 no_ooae = inst.no_ooae ;
@@ -1431,7 +1450,7 @@ struct test {
14311450 field == " model_size" || field == " model_n_params" ||
14321451 field == " n_gpu_layers" || field == " main_gpu" ||
14331452 field == " n_prompt" || field == " n_gen" || field == " mla_attn" || field == " attn_max_batch" ||
1434- field == " avg_ns" || field == " stddev_ns" ) {
1453+ field == " avg_ns" || field == " stddev_ns" || field == " fdn " ) {
14351454 return INT ;
14361455 }
14371456 if (field == " cuda" || field == " vulkan" || field == " kompute" || field == " metal" ||
@@ -1483,7 +1502,7 @@ struct test {
14831502 std::to_string (mla_attn), std::to_string (attn_max_batch), ser_to_string (ser), std::to_string (reuse),
14841503 tensor_split_str, std::to_string (use_mmap), std::to_string (use_direct_io), std::to_string (embeddings),
14851504 std::to_string (repack), std::to_string (mqkv), std::to_string (muge), std::to_string (fmoe), std::to_string (ger),
1486- std::to_string (no_fug), std::to_string (use_thp), std::to_string (no_ooae), std::to_string (rcache), std::to_string (sas),
1505+ std::to_string (no_fug), std::to_string (use_thp), std::to_string (no_ooae), std::to_string (rcache), std::to_string (sas), std::to_string (fdn),
14871506 cuda_params, override_tensor,
14881507 std::to_string (n_prompt), std::to_string (n_gen), test_time,
14891508 std::to_string (avg_ns ()), std::to_string (stdev_ns ()),
@@ -1505,7 +1524,7 @@ struct test {
15051524 " main_gpu" , " no_kv_offload" , " flash_attn" , " mla_attn" , " attn_max_batch" , " ser" , " reuse" ,
15061525 " tensor_split" , " use_mmap" , " use_direct_io" , " embeddings" ,
15071526 " repack" , " mqkv" , " muge" , " fused_moe" , " grouped_er" ,
1508- " no_fused_up_gate" , " use_thp" , " no_ooae" , " rcache" , " sas" , " cuda_params" , " override_tensor" ,
1527+ " no_fused_up_gate" , " use_thp" , " no_ooae" , " rcache" , " sas" , " fdn " , " cuda_params" , " override_tensor" ,
15091528 " n_prompt" , " n_gen" , " test_time" ,
15101529 " avg_ns" , " stddev_ns" ,
15111530 " avg_ts" , " stddev_ts" , " test" ,
@@ -1698,6 +1717,9 @@ struct markdown_printer : public printer {
16981717 if (field == " sas" ) {
16991718 return 3 ;
17001719 }
1720+ if (field == " fdn" ) {
1721+ return 4 ;
1722+ }
17011723 if (field == " use_thp" ) {
17021724 return 3 ;
17031725 }
@@ -1774,6 +1796,9 @@ struct markdown_printer : public printer {
17741796 if (field == " sas" ) {
17751797 return " sas" ;
17761798 }
1799+ if (field == " fdn" ) {
1800+ return " fdn" ;
1801+ }
17771802 if (field == " use_thp" ) {
17781803 return " thp" ;
17791804 }
@@ -1887,6 +1912,9 @@ struct markdown_printer : public printer {
18871912 if (params.sas != cmd_params_defaults.sas ) {
18881913 fields.emplace_back (" sas" );
18891914 }
1915+ if (params.fdn != cmd_params_defaults.fdn ) {
1916+ fields.emplace_back (" fdn" );
1917+ }
18901918 if (params.muge != cmd_params_defaults.muge ) {
18911919 fields.emplace_back (" muge" );
18921920 }
0 commit comments