Skip to content

Commit b567dfd

Browse files
authored
master: restart tasks after data import (#1130)
1 parent 0186811 commit b567dfd

26 files changed

+468
-565
lines changed

common/monitor/progress.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ func Start(ctx context.Context, name string, total int) (context.Context, *Span)
166166
}
167167
span, ok := (ctx).Value(spanKeyName).(*Span)
168168
if !ok {
169-
return nil, childSpan
169+
return ctx, childSpan
170170
}
171171
span.children.Store(name, childSpan)
172172
return context.WithValue(ctx, spanKeyName, childSpan), childSpan

common/nn/tensor.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ package nn
1616

1717
import (
1818
"container/heap"
19+
"context"
1920
"fmt"
2021
"math"
2122
"math/rand"
@@ -561,7 +562,7 @@ func (t *Tensor) batchMatMul(other *Tensor, transpose1, transpose2 bool, jobs in
561562
}
562563
b, m, n, k = t.shape[0], t.shape[1], other.shape[2], t.shape[2]
563564
result = make([]float32, b*m*n)
564-
parallel.For(b, jobs, func(i int) {
565+
_ = parallel.For(context.Background(), b, jobs, func(i int) {
565566
floats.MM(transpose1, transpose2, m, n, k, t.data[i*m*k:(i+1)*m*k], k, other.data[i*n*k:(i+1)*n*k], n, result[i*m*n:(i+1)*m*n], n)
566567
})
567568
} else if transpose1 && !transpose2 {
@@ -570,7 +571,7 @@ func (t *Tensor) batchMatMul(other *Tensor, transpose1, transpose2 bool, jobs in
570571
}
571572
b, m, n, k = t.shape[0], t.shape[2], other.shape[2], t.shape[1]
572573
result = make([]float32, b*m*n)
573-
parallel.For(b, jobs, func(i int) {
574+
_ = parallel.For(context.Background(), b, jobs, func(i int) {
574575
floats.MM(transpose1, transpose2, m, n, k, t.data[i*m*k:(i+1)*m*k], m, other.data[i*n*k:(i+1)*n*k], n, result[i*m*n:(i+1)*m*n], n)
575576
})
576577
} else if !transpose1 && transpose2 {
@@ -579,7 +580,7 @@ func (t *Tensor) batchMatMul(other *Tensor, transpose1, transpose2 bool, jobs in
579580
}
580581
b, m, n, k = t.shape[0], t.shape[1], other.shape[1], t.shape[2]
581582
result = make([]float32, b*m*n)
582-
parallel.For(b, jobs, func(i int) {
583+
_ = parallel.For(context.Background(), b, jobs, func(i int) {
583584
floats.MM(transpose1, transpose2, m, n, k, t.data[i*m*k:(i+1)*m*k], k, other.data[i*n*k:(i+1)*n*k], k, result[i*m*n:(i+1)*m*n], n)
584585
})
585586
} else {
@@ -588,7 +589,7 @@ func (t *Tensor) batchMatMul(other *Tensor, transpose1, transpose2 bool, jobs in
588589
}
589590
b, m, n, k = t.shape[0], t.shape[2], other.shape[1], t.shape[1]
590591
result = make([]float32, b*m*n)
591-
parallel.For(b, jobs, func(i int) {
592+
_ = parallel.For(context.Background(), b, jobs, func(i int) {
592593
floats.MM(transpose1, transpose2, m, n, k, t.data[i*m*k:(i+1)*m*k], m, other.data[i*n*k:(i+1)*n*k], k, result[i*m*n:(i+1)*m*n], n)
593594
})
594595
}

common/parallel/condition_channel.go

Lines changed: 0 additions & 51 deletions
This file was deleted.

common/parallel/condition_channel_test.go

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)