@@ -1906,10 +1906,6 @@ void llama_context::opt_epoch_iter(
19061906
19071907 llama_kv_cache * kv_self = static_cast <llama_kv_cache *>(memory.get ());
19081908
1909- // is_encoding = false;
1910- // llama_kv_cache_clear(lctx);
1911- // llama_kv_slot_restorer kv_slot_restorer(lctx->kv_self);
1912-
19131909 kv_self->clear ();
19141910 llama_kv_cache_guard kv_guard (kv_self);
19151911
@@ -1923,11 +1919,6 @@ void llama_context::opt_epoch_iter(
19231919 batch.logits [pos_batch] = true ;
19241920 }
19251921
1926- // {
1927- // const int err_code = llama_prepare_sbatch(*lctx, batch, n_outputs);
1928- // GGML_ASSERT(err_code == 0);
1929- // }
1930-
19311922 const auto n_tokens_all = batch.n_tokens ;
19321923
19331924 n_queued_tokens += n_tokens_all;
@@ -1939,7 +1930,7 @@ void llama_context::opt_epoch_iter(
19391930
19401931 int64_t n_outputs_all = n_tokens_all;
19411932
1942- llama_sbatch sbatch = kv_self->sbatch_init (batch, /* logits_all */ true );
1933+ llama_sbatch sbatch = kv_self->sbatch_init (batch, /* logits_all = */ true );
19431934
19441935 // reserve output buffer
19451936 if (output_reserve (n_outputs_all) < n_outputs_all) {
@@ -1948,11 +1939,6 @@ void llama_context::opt_epoch_iter(
19481939 };
19491940
19501941 for (uint32_t pos_batch = 0 ; pos_batch < n_batch; pos_batch += n_ubatch) {
1951- // struct llama_ubatch ubatch;
1952- // {
1953- // const int err_code = llama_prepare_ubatch(*lctx, kv_slot_restorer, ubatch, n_outputs, batch.n_tokens);
1954- // GGML_ASSERT(err_code == 0);
1955- // }
19561942 llama_ubatch ubatch = kv_self->ubatch_next (sbatch, cparams.n_ubatch , embd_pooled);
19571943
19581944 n_outputs = ubatch.n_tokens ;
@@ -1967,7 +1953,6 @@ void llama_context::opt_epoch_iter(
19671953 auto * gf = graph_init ();
19681954 auto res = graph_build (ctx_compute.get (), gf, ubatch, LLM_GRAPH_TYPE_DEFAULT);
19691955
1970- // struct ggml_cgraph * gf = llama_build_graph(*lctx, ubatch, false);
19711956 struct ggml_context * ctx_compute_opt;
19721957 {
19731958 const size_t size_gf = ggml_graph_size (gf);
@@ -1981,7 +1966,6 @@ void llama_context::opt_epoch_iter(
19811966 }
19821967 ggml_opt_prepare_alloc (opt_ctx, ctx_compute_opt, gf, res->get_tokens (), res->get_logits ());
19831968 ggml_opt_alloc (opt_ctx, train);
1984- // llama_set_inputs(*lctx, ubatch);
19851969 res->set_inputs (&ubatch);
19861970 {
19871971 struct ggml_tensor * labels = ggml_opt_labels (opt_ctx);
0 commit comments