Repository navigation
Commit 1f2584d
fix: Pin expected tensor to same device in online retrieval test (#6777)
test_get_online_features computes `device` from torch.cuda.is_available()
and passes it when building the expected tensors for `driver_id` and
`trips`, but the `avg_orders_day` assertion omits it.
OnlineResponse.to_tensor() places its output on cuda when a GPU is
present (sdk/python/feast/online_response.py), so on a GPU host the
expected tensor stays on cpu and torch.equal raises:
RuntimeError: Expected all tensors to be on the same device, but got
other is on cpu, different from other tensors on cuda:0
(when checking argument in method wrapper_CUDA__equal)
CI runs CPU-only, where `device` resolves to "cpu" and the omission has
no effect, so this only reproduces on machines with CUDA available.
Verified on a CUDA host: the unmodified test fails with the GPU visible
and passes under CUDA_VISIBLE_DEVICES="", while the patched test passes
in both cases.
Signed-off-by: Piyush Mondal <[email protected]>
Co-authored-by: Francisco Javier Arceo <[email protected]>1 parent 8ab92e8 commit 1f2584d
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
162 | 164 | | |
163 | 165 | | |
164 | 166 | | |
| |||
0 commit comments