Unverified Commit b1be5b88 authored by Boyuan Yao's avatar Boyuan Yao Committed by GitHub
Browse files

[autoparallel] fix insecure subprocess (#1680)

* [autoparallel] fix insecure subprocess

* [fx] fix insecure subprocess
parent d8420f81
import sys
from typing import List, Tuple from typing import List, Tuple
from torch.fx import Node from torch.fx import Node
from colossalai.fx.graph_module import ColoGraphModule from colossalai.fx.graph_module import ColoGraphModule
...@@ -353,10 +354,13 @@ def solver_rotor(gm: ColoGraphModule, ...@@ -353,10 +354,13 @@ def solver_rotor(gm: ColoGraphModule,
logger.info("dynamic_programs_C_version hasn't been built! Building library...", ranks=[0]) logger.info("dynamic_programs_C_version hasn't been built! Building library...", ranks=[0])
this_dir = os.path.dirname(os.path.abspath(__file__)) this_dir = os.path.dirname(os.path.abspath(__file__))
result = subprocess.Popen( result = subprocess.Popen(
f'python {os.path.join(this_dir, "build_c_ext.py")} build_ext --build-lib={this_dir}', [
f"{sys.executable}", f"{os.path.join(this_dir, 'build_c_ext.py')}", "build_ext",
f"--build-lib={this_dir}"
],
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, stderr=subprocess.PIPE,
shell=True) )
if result.wait() == 0: if result.wait() == 0:
logger.info("dynamic_programs_C_version has been built!", ranks=[0]) logger.info("dynamic_programs_C_version has been built!", ranks=[0])
from .dynamic_programs_C_version import persistent_compute_table from .dynamic_programs_C_version import persistent_compute_table
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment