@@ -7,8 +7,10 @@ open Backend_impl
77
88let _get_local_debug_runtime = Utils. get_local_debug_runtime
99
10- [%% global_debug_log_level 9 ]
11- [%% global_debug_log_level_from_env_var " OCANNL_LOG_LEVEL" ]
10+ [%% global_debug_log_level 0 ]
11+
12+ (* export OCANNL_LOG_LEVEL_BACKENDS=9 to enable debugging logs. *)
13+ [%% global_debug_log_level_from_env_var " OCANNL_LOG_LEVEL_BACKENDS" ]
1214
1315let check_merge_buffer stream ~code_node =
1416 let name = function Some tn -> Tnode. debug_name tn | None -> " none" in
@@ -40,7 +42,7 @@ module Add_buffer_retrieval_and_syncing (Backend : No_buffer_retrieval_or_syncin
4042 |> Option. iter ~f: (fun upd_e ->
4143 if not (equal_stream s d || Backend. is_done upd_e) then Backend. will_wait_for dst upd_e)
4244
43- let % track2_sexp to_host (ctx : Backend.context ) (tn : Tn.t ) =
45+ let % track3_sexp to_host (ctx : Backend.context ) (tn : Tn.t ) =
4446 match (tn, Map. find ctx.ctx_arrays tn) with
4547 | { Tn. array = (lazy (Some hosted )); _ } , Some src ->
4648 if Tn. potentially_cross_stream tn then
@@ -87,7 +89,7 @@ module Add_buffer_retrieval_and_syncing (Backend : No_buffer_retrieval_or_syncin
8789 (* Note: the previous event does not need to be done! *)
8890 s.updating_for_merge_buffer < - Some (tn, Some e)
8991
90- let % track2_sexp from_host (ctx : Backend.context ) tn =
92+ let % track3_sexp from_host (ctx : Backend.context ) tn =
9193 match (tn, Map. find ctx.ctx_arrays tn) with
9294 | { Tn. array = (lazy (Some hosted )); _ } , Some dst ->
9395 wait_for_all ctx ctx.stream.reader_streams tn;
@@ -98,7 +100,7 @@ module Add_buffer_retrieval_and_syncing (Backend : No_buffer_retrieval_or_syncin
98100 true
99101 | _ -> false
100102
101- let % track2_sexp init_from_host (ctx : Backend.context ) tn =
103+ let % track3_sexp init_from_host (ctx : Backend.context ) tn =
102104 match (tn, Map. find ctx.ctx_arrays tn) with
103105 | { Tn. array = (lazy (Some hosted )); _ } , None ->
104106 let dims = Lazy. force tn.dims in
@@ -120,7 +122,7 @@ module Add_buffer_retrieval_and_syncing (Backend : No_buffer_retrieval_or_syncin
120122 (" init_from_host: tensor node is not hosted: " ^ Tn. debug_name tn ^ " , for stream "
121123 ^ Backend. get_name ctx.stream)
122124
123- let % track2_sexp device_to_device (tn : Tn.t ) ~into_merge_buffer ~(dst : Backend.context )
125+ let % track3_sexp device_to_device (tn : Tn.t ) ~into_merge_buffer ~(dst : Backend.context )
124126 ~(src : Backend.context ) =
125127 let ordinal_of ctx = ctx.stream.device.ordinal in
126128 let name_of ctx = Backend. (get_name ctx.stream) in
@@ -159,7 +161,7 @@ module Add_buffer_retrieval_and_syncing (Backend : No_buffer_retrieval_or_syncin
159161 [% log " streaming into merge buffer" , Tn. debug_name tn, " from" , name_of src];
160162 true )
161163
162- let % track2_sexp init_from_device (tn : Tn.t ) ~(dst : Backend.context ) ~(src : Backend.context ) =
164+ let % track3_sexp init_from_device (tn : Tn.t ) ~(dst : Backend.context ) ~(src : Backend.context ) =
163165 let ordinal_of ctx = ctx.stream.device.ordinal in
164166 let name_of ctx = Backend. (get_name ctx.stream) in
165167 match Map. find src.ctx_arrays tn with
@@ -491,11 +493,11 @@ module Raise_backend (Device : Lowered_backend) : Backend = struct
491493 [% log " Backends.alloc_if_needed: failed to add old node to context" , (key : Tnode.t )];
492494 raise exn
493495 in
494- let hash_find_exn ~message tbl =
496+ let hash_find_exn ~message : _msg tbl =
495497 try Hashtbl. find_exn tbl key
496498 with exn ->
497499 [% log
498- " Backends.alloc_if_needed: failed to find node in hash table" , message , (key : Tnode.t )];
500+ " Backends.alloc_if_needed: failed to find node in hash table" , _msg , (key : Tnode.t )];
499501 raise exn
500502 in
501503 let device = stream.device in
0 commit comments