Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
revert scratch without SYCL
Browse files Browse the repository at this point in the history
  • Loading branch information
luoyu-intel committed Jun 21, 2024
1 parent c5fd1cf commit 819ff39
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion neural_speed/models/model_utils/model_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1123,12 +1123,17 @@ struct model_context* model_init_from_file(const char* path_model, struct model_
(32ULL * ctx->n_ctx * hparams.n_embd + 2ULL * ctx->n_ctx * hparams.ffn_hidden_size) *
ne_type_size(NE_TYPE_F32) +
(10 << 20);
#ifdef NS_SYCL
ctx->buf_compute.resize(act_mem_per_layer);
ctx->buf_scratch[0].resize(act_mem_per_layer);
fprintf(stderr, "%s: cpu activation size = %7.2f MB\n", __func__, act_mem_per_layer / 1024.0 / 1024.0);
#ifdef NS_SYCL
model_alloc_sycl_mem(ctx->dev_ctx, act_mem_per_layer);
fprintf(stderr, "%s: gpu activation size = %7.2f MB\n", __func__, act_mem_per_layer / 1024.0 / 1024.0);
#else
ctx->buf_compute.resize(ctx->model.scratchs.eval);

ctx->buf_scratch[0].resize(ctx->model.scratchs.scratch0);
ctx->buf_scratch[1].resize(ctx->model.scratchs.scratch1);
#endif
}

Expand Down

0 comments on commit 819ff39

Please sign in to comment.