File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -264,12 +264,12 @@ end) : Ir.Backend_impl.Lowered_backend = struct
264264
265265 let use_host_memory = None
266266 let procs = Input. procs
267+
267268 let full_printf_support =
268269 not @@ Bool. of_string
269270 @@ Utils. get_global_arg ~default: " false" ~arg_name: " prefer_backend_uniformity"
270271 end )
271272
272- let logs_to_stdout = true
273273 let main_kernel_prefix = " extern \" C\" __global__"
274274
275275 let kernel_prep_line =
@@ -450,7 +450,7 @@ end) : Ir.Backend_impl.Lowered_backend = struct
450450 let open PPrint in
451451 let format_string_literal =
452452 ! Utils. captured_log_prefix ^ " %d: "
453- ^ String. substr_replace_all base_message_literal ~pattern: " \n " ~with_: " $"
453+ ^ String. substr_replace_all base_message_literal ~pattern: " \n " ~with_: " $" ^ " \\ n "
454454 in
455455 let all_args =
456456 match log_param_c_expr_doc with
@@ -568,7 +568,6 @@ end) : Ir.Backend_impl.Lowered_backend = struct
568568 [% log " launching the kernel" ];
569569 (* Stdio.printf "launching %s\n" name; *)
570570 (if Utils. debug_log_from_routines () then
571- (* FIXME: this needs to use Utils.log_debug_routine_logs. *)
572571 Utils. add_log_processor ~prefix: log_id_prefix @@ fun log_contents ->
573572 Utils. log_debug_routine_logs ~log_contents ~stream_name );
574573 S. launch_kernel func ~grid_dim_x: 1 ~block_dim_x: 1 ~shared_mem_bytes: 0 stream.runner args;
Original file line number Diff line number Diff line change 4040 "--ocannl_debug_log_to_stream_files=true")))
4141
4242(rule
43+ (deps "log_files/%{read:config/ocannl_backend.txt}-0-0.log")
4344 (target "%{read:config/ocannl_backend.txt}-0-0.log.actual")
4445 (action
4546 (progn
Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ let () =
3232 List. iter ~f: (Option. iter ~f: (fun diff -> Train. set_hosted diff.Tensor. grad)) [ a.diff; b.diff ];
3333 let update = Train. grad_update g in
3434 let step = Train. to_routine (module Backend ) ctx IDX. empty update.fwd_bprop in
35+ Utils. capture_stdout_logs @@ fun () ->
3536 Train. run step;
3637 Tensor. print ~with_code: false ~with_grad: false `Default g;
3738 Tensor. print ~with_code: false ~with_grad: true `Default a;
38- Tensor. print ~with_code: false ~with_grad: true `Default b
39+ Tensor. print ~with_code: false ~with_grad: true `Default b
You can’t perform that action at this time.
0 commit comments