Skip to content

Commit

Permalink
Fix IL bug: job misses first data when reads data.
Browse files Browse the repository at this point in the history
Signed-off-by: JimmyYang20 <yangjin39@huawei.com>
  • Loading branch information
JimmyYang20 committed Nov 16, 2021
1 parent 404fed4 commit 9da7acb
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1030,18 +1030,17 @@ func (im *Manager) handleData(job *Job) {

jobConfig.Lock.Lock()
jobConfig.DataSamples.TrainSamples = append(jobConfig.DataSamples.TrainSamples,
samples[(previousNumberOfSamples+1):(previousNumberOfSamples+trainNum+1)]...)
samples[previousNumberOfSamples:previousNumberOfSamples+trainNum]...)
klog.Infof("job(%s)'s current train samples nums is %d", jobConfig.UniqueIdentifier, trainNum)

jobConfig.DataSamples.EvalVersionSamples = append(jobConfig.DataSamples.EvalVersionSamples,
samples[(previousNumberOfSamples+trainNum+1):])
samples[previousNumberOfSamples+trainNum:])
jobConfig.Lock.Unlock()

for _, v := range jobConfig.DataSamples.EvalVersionSamples {
jobConfig.DataSamples.EvalSamples = append(jobConfig.DataSamples.EvalSamples, v...)
}
evalNum := newNumberOfSamples - trainNum
klog.Infof("job(%s)'s current eval samples nums is %d", jobConfig.UniqueIdentifier, evalNum)
klog.Infof("job(%s)'s current eval samples nums is %d", jobConfig.UniqueIdentifier, len(jobConfig.DataSamples.EvalSamples))

jobConfig.DataSamples.PreviousNumbers = currentNumberOfSamples
}
Expand Down

0 comments on commit 9da7acb

Please sign in to comment.