Expected Behavior
sdk/python/tests/unit/online_store/test_online_retrieval.py::test_get_online_features should pass on any host, with or without a CUDA device.
Current Behavior
On a host with CUDA available, the test fails:
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)
OnlineResponse.to_tensor() places its output on cuda when a GPU is present (sdk/python/feast/online_response.py), but the avg_orders_day assertion builds its expected tensor without a device= argument, so it stays on cpu.
The test already computes device and passes it for the driver_id and trips assertions — only avg_orders_day omits it.
Steps to reproduce
On a machine with CUDA-enabled torch installed:
python -m pytest sdk/python/tests/unit/online_store/test_online_retrieval.py::test_get_online_features
Fails with the GPU visible; passes under CUDA_VISIBLE_DEVICES="". CI is CPU-only, where device resolves to "cpu" and the omission has no effect.
Specifications
- Version: master (0.66.0 dev)
- Platform: Ubuntu 24.04 (WSL2), Python 3.11, torch 2.13.0+cu130, RTX 4050
- Subsystem: online store / tests
Possible Solution
Pass device=device to the expected tensor, matching the neighbouring assertions. Submitted as #6777.
Expected Behavior
sdk/python/tests/unit/online_store/test_online_retrieval.py::test_get_online_featuresshould pass on any host, with or without a CUDA device.Current Behavior
On a host with CUDA available, the test fails:
OnlineResponse.to_tensor()places its output oncudawhen a GPU is present (sdk/python/feast/online_response.py), but theavg_orders_dayassertion builds its expected tensor without adevice=argument, so it stays oncpu.The test already computes
deviceand passes it for thedriver_idandtripsassertions — onlyavg_orders_dayomits it.Steps to reproduce
On a machine with CUDA-enabled torch installed:
Fails with the GPU visible; passes under
CUDA_VISIBLE_DEVICES="". CI is CPU-only, wheredeviceresolves to"cpu"and the omission has no effect.Specifications
Possible Solution
Pass
device=deviceto the expected tensor, matching the neighbouring assertions. Submitted as #6777.