Skip to content

Commit

Permalink
Fixed GPU-based scoring by copying to cpu tensor first before convert…
Browse files Browse the repository at this point in the history
…ing to numpy. (#1020)
  • Loading branch information
fhieber authored Feb 8, 2022
1 parent 1dc7396 commit 9e11f7b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ Note that Sockeye has checks in place to not translate with an old model that wa

Each version section may have subsections for: _Added_, _Changed_, _Removed_, _Deprecated_, and _Fixed_.

## [3.0.15]

### Fixed
- Fixed GPU-based scoring by copying to cpu tensor first before converting to numpy.

## [3.0.14]

### Added
Expand Down
2 changes: 1 addition & 1 deletion sockeye/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.

__version__ = '3.0.14'
__version__ = '3.0.15'
2 changes: 1 addition & 1 deletion sockeye/scoring_pt.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def score_batch(self, batch: data_io_pt.Batch):
self.traced_batch_scorer = pt.jit.trace(self.batch_scorer, scorer_inputs, strict=False)
scores = self.traced_batch_scorer(*scorer_inputs) # (batch, num_target_factors)

return scores.numpy()
return scores.cpu().numpy()

@pt.inference_mode(True)
def score(self, score_iter: data_io_pt.BaseParallelSampleIter, output_handler: OutputHandler):
Expand Down

0 comments on commit 9e11f7b

Please sign in to comment.