async def _upload_files(self, instance: Instance, local_files: Dict[str, str]) -> bool:
        """
        Upload all necessary files to the instance.

        Args:
            instance: The MorphCloud instance
            local_files: Dictionary mapping remote paths to local file paths

        Returns:
            bool: True if all uploads were successful

        Raises:
            TimeoutError: If uploads time out
        """
        for remote_name, local_path in local_files.items():
            target_path = f"/workspace/{remote_name}"
            dir_path = os.path.dirname(target_path)

            if dir_path != "/workspace":
                await instance.aexec(f"mkdir -p {dir_path}")

            await instance.aupload(local_path, target_path)

        await instance.aupload(local_files["grader_config.json"], "/workspace/graders/grader_config.json")

        return True

        Upload all necessary files to the instance.

        Args:
            instance: The MorphCloud instance
            local_files: Dictionary mapping remote paths to local file paths

        Returns:
            bool: True if all uploads were successful

        Raises:
            TimeoutError: If uploads time out
        
src/open_r1/utils/competitive_programming/morph_client.py