@@ -269,16 +269,6 @@ let every_non_literal_on_host =
269269 Tensor. iter_embedded ~f: (fun a ->
270270 if Tn. mode_is_unspecified a && not (Tn. known_constant a) then set_hosted a)
271271
272- (* Note: this will get nicer with modular explicits. *)
273- let % debug2_sexp all_host_to_device (type buffer_ptr dev runner event)
274- (module Backend : Backend
275- with type buffer_ptr = buffer_ptr
276- and type dev = dev
277- and type runner = runner
278- and type event = event) (context : Backend.context ) =
279- let f tn = ignore (Backend. from_host context tn : bool ) in
280- Tensor. iter_embedded ~f
281-
282272module Lazy = Utils. Lazy
283273
284274(* * Performs one optimization step, potentially in parallel (if [grad_updates] are linked with
@@ -469,8 +459,6 @@ let example_train_loop ?(disable_rootness_check = false) ~seed ~batch_size ~init
469459 let sgd_update = to_routine (module Backend ) grad_updates.(0 ).context bindings sgd in
470460 Tensor. log_debug_info ~from_log_level: 2 inputs;
471461 Tensor. log_debug_info ~from_log_level: 2 outputs;
472- all_host_to_device (module Backend ) sgd_update.context scalar_loss;
473- all_host_to_device (module Backend ) sgd_update.context learning_rate;
474462 let open Operation.At in
475463 let epoch_loss = ref 0. in
476464 let step_ref = IDX. find_exn sgd_update.bindings step_n in
@@ -531,7 +519,6 @@ let example_train_loop ?(disable_rootness_check = false) ~seed ~batch_size ~init
531519 (* For the gccjit backend, infer is only on host, not on device. For cuda, this will be
532520 needed. *)
533521 Utils. capture_stdout_logs @@ fun () ->
534- assert (Backend. from_host routine.context infer.value);
535522 run routine;
536523 Tn. get_values model_result.value
537524 in
@@ -558,7 +545,6 @@ let%track3_sexp forward_and_ctx ?(disable_rootness_check = false) (type buffer_p
558545 and type event = event) ctx ?(bindings = IDX. empty) t =
559546 let routine = Backend. (link ctx @@ compile bindings @@ forward ~disable_rootness_check t) in
560547 if not disable_rootness_check then Tensor. remove_bprop_root t;
561- Tensor. iter_embedded t ~f: (fun a -> ignore (Backend. from_host routine.context a : bool ));
562548 Task. run routine.schedule;
563549 routine.context
564550
0 commit comments