From 1db4a42881a7a7b3fdaac0c0091d1d7c71656fd4 Mon Sep 17 00:00:00 2001 From: AkashKarnatak Date: Wed, 21 May 2025 23:22:30 +0530 Subject: [PATCH] fix: use deepcopy to clone stateful objects like KVCache. this prevents mismatch during check_implementation --- problems/amd/eval.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/problems/amd/eval.py b/problems/amd/eval.py index ac3a632..8f56312 100644 --- a/problems/amd/eval.py +++ b/problems/amd/eval.py @@ -8,6 +8,7 @@ import math from pathlib import Path from typing import Any, Optional +from copy import deepcopy import torch.cuda @@ -135,7 +136,7 @@ def _clone_data(data): elif isinstance(data, torch.Tensor): return data.clone() else: - return data + return deepcopy(data) def wrap_check_implementation(data, submission_output):