@@ -9258,22 +9258,17 @@ struct ggml_compute_state {
9258
9258
static void ggml_graph_compute_thread (void * data ) {
9259
9259
struct ggml_compute_state * state = (struct ggml_compute_state * ) data ;
9260
9260
int type = state -> params .type ;
9261
- if (state -> node ) {
9262
- if (state -> params .ith < state -> params .nth ) {
9263
- if (type == GGML_TASK_INIT )
9264
- {
9265
- state -> params .type = GGML_TASK_INIT ;
9266
- ggml_compute_forward (& state -> params , state -> node );
9267
- type = GGML_TASK_COMPUTE ;
9268
- }
9261
+ if (type == GGML_TASK_INIT )
9262
+ {
9263
+ state -> params .type = GGML_TASK_INIT ;
9264
+ ggml_compute_forward (& state -> params , state -> node );
9265
+ type = GGML_TASK_COMPUTE ;
9266
+ }
9269
9267
9270
- if (type == GGML_TASK_COMPUTE )
9271
- {
9272
- state -> params .type = GGML_TASK_COMPUTE ;
9273
- ggml_compute_forward (& state -> params , state -> node );
9274
- }
9275
- }
9276
- state -> node = NULL ;
9268
+ if (type == GGML_TASK_COMPUTE )
9269
+ {
9270
+ state -> params .type = GGML_TASK_COMPUTE ;
9271
+ ggml_compute_forward (& state -> params , state -> node );
9277
9272
}
9278
9273
}
9279
9274
@@ -9284,18 +9279,6 @@ void ggml_graph_compute(struct ggml_context * ctx, struct ggml_cgraph * cgraph)
9284
9279
9285
9280
// create thread pool
9286
9281
ctx -> tpool = thpool_init (n_threads );
9287
- for (int j = 0 ; j < n_threads - 1 ; j ++ ) {
9288
- workers [j ] = (struct ggml_compute_state ) {
9289
- .params = {
9290
- .type = GGML_TASK_COMPUTE ,
9291
- .ith = j + 1 ,
9292
- .nth = n_threads ,
9293
- .wsize = cgraph -> work ? ggml_nbytes (cgraph -> work ) : 0 ,
9294
- .wdata = cgraph -> work ? cgraph -> work -> data : NULL ,
9295
- },
9296
- .node = NULL ,
9297
- };
9298
- }
9299
9282
9300
9283
// initialize tasks + work buffer
9301
9284
{
0 commit comments