From 4d9316e8e8e28f5ec1e82fd9711704fbd0456d98 Mon Sep 17 00:00:00 2001 From: Mehrdad Hessar Date: Mon, 6 Jun 2022 17:31:26 +0000 Subject: [PATCH] add random string to directory name --- python/tvm/contrib/hexagon/build.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/tvm/contrib/hexagon/build.py b/python/tvm/contrib/hexagon/build.py index 43856253cb18..c659d66bec5d 100644 --- a/python/tvm/contrib/hexagon/build.py +++ b/python/tvm/contrib/hexagon/build.py @@ -25,6 +25,8 @@ import signal import socket import stat +import random +import string import subprocess from typing import Union @@ -58,7 +60,9 @@ def _get_hexagon_rpc_lib_dir() -> pathlib.Path: def _get_test_directory_name() -> str: """Generate a time-stamped name for use as a test directory name.""" - return datetime.datetime.now().strftime("%Y-%m-%dT%H-%M-%S") + date_str = datetime.datetime.now().strftime("%Y-%m-%dT%H-%M-%S") + random_str = "".join(random.choice(string.ascii_lowercase) for _ in range(10)) + return f"{date_str}-{random_str}" class HexagonLauncherRPC(metaclass=abc.ABCMeta):