Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions notebooks/05_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
N = env.num_agents

device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
config["policy"]["fused_slot_encoder"] = config["policy"]["fused_slot_encoder"] and device.type == "cuda"
policy = DrivePolicy(env, **config["policy"]).to(device)

if CHECKPOINT_PATH:
Expand Down
1 change: 1 addition & 0 deletions tests/eval/test_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,7 @@ def test_policy_builds_from_the_released_driver_env(sdc_replay_map_dir):
with patch.object(sys, "argv", ["pufferl.py"]):
args = pufferl.load_config("puffer_drive")
args["train"]["device"] = "cpu"
args["policy"]["fused_slot_encoder"] = False # the fused encoder needs triton, which is CUDA-only
env_kwargs = {
"num_agents": SDC_SCENARIO_COUNT,
"num_maps": SDC_SCENARIO_COUNT,
Expand Down
3 changes: 2 additions & 1 deletion tests/unit_tests/test_action_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ def test_drive_mean_action_is_exact_in_physical_units(monkeypatch):
action_type="continuous",
)
try:
policy = ocean_torch.Drive(env, **args["policy"])
# the fused encoder is a CUDA/triton kernel and plays no part in the action table
policy = ocean_torch.Drive(env, **{**args["policy"], "fused_slot_encoder": False})

num_lat = len(binding.JERK_LAT)
lat_zero_idx = binding.JERK_LAT.index(0.0)
Expand Down
Loading