Compare commits
5 Commits
main
...
suyue/perf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8fa1119850 | ||
|
|
d6255cf38c | ||
|
|
06e0910411 | ||
|
|
b45fc4f3bd | ||
|
|
6916390cc1 |
@@ -37,7 +37,7 @@ deploy:
|
|||||||
|
|
||||||
llm:
|
llm:
|
||||||
engine: vllm # or tgi
|
engine: vllm # or tgi
|
||||||
model_id: "meta-llama/Meta-Llama-3-8B-Instruct" # mandatory
|
model_id: "meta-llama/Llama-3.1-8B-Instruct" # mandatory
|
||||||
replicaCount:
|
replicaCount:
|
||||||
with_teirerank: [7, 15, 31, 63] # When teirerank.enabled is True
|
with_teirerank: [7, 15, 31, 63] # When teirerank.enabled is True
|
||||||
without_teirerank: [8, 16, 32, 64] # When teirerank.enabled is False
|
without_teirerank: [8, 16, 32, 64] # When teirerank.enabled is False
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ def configure_rerank(values, with_rerank, deploy_config, example_type, node_sele
|
|||||||
values["teirerank"]["nodeSelector"] = {key: value for key, value in node_selector.items()}
|
values["teirerank"]["nodeSelector"] = {key: value for key, value in node_selector.items()}
|
||||||
else:
|
else:
|
||||||
if example_type == "chatqna":
|
if example_type == "chatqna":
|
||||||
values["image"] = {"repository": "opea/chatqna-without-rerank"}
|
values["CHATQNA_TYPE"] = "CHATQNA_NO_RERANK"
|
||||||
if "teirerank" not in values:
|
if "teirerank" not in values:
|
||||||
values["teirerank"] = {"enabled": False}
|
values["teirerank"] = {"enabled": False}
|
||||||
elif "enabled" not in values["teirerank"]:
|
elif "enabled" not in values["teirerank"]:
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ def pull_helm_chart(chart_pull_url, version, chart_name):
|
|||||||
return untar_dir
|
return untar_dir
|
||||||
|
|
||||||
|
|
||||||
def main(yaml_file, target_node=None, test_mode="oob"):
|
def main(yaml_file, target_node=None, test_mode="oob", clean_up=True):
|
||||||
"""Main function to process deployment configuration.
|
"""Main function to process deployment configuration.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@@ -278,6 +278,9 @@ def main(yaml_file, target_node=None, test_mode="oob"):
|
|||||||
chart_dir,
|
chart_dir,
|
||||||
]
|
]
|
||||||
result = subprocess.run(cmd, check=True, capture_output=True, text=True)
|
result = subprocess.run(cmd, check=True, capture_output=True, text=True)
|
||||||
|
print("Show deploy logs...")
|
||||||
|
print(result.stdout)
|
||||||
|
print("End of show deploy logs.")
|
||||||
|
|
||||||
match = re.search(r"values_file_path: (\S+)", result.stdout)
|
match = re.search(r"values_file_path: (\S+)", result.stdout)
|
||||||
if match:
|
if match:
|
||||||
@@ -306,6 +309,9 @@ def main(yaml_file, target_node=None, test_mode="oob"):
|
|||||||
"--update-service",
|
"--update-service",
|
||||||
]
|
]
|
||||||
result = subprocess.run(cmd, check=True, capture_output=True, text=True)
|
result = subprocess.run(cmd, check=True, capture_output=True, text=True)
|
||||||
|
print("Show deploy logs...")
|
||||||
|
print(result.stdout)
|
||||||
|
print("End of show deploy logs.")
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
print(f"Update failed for {node} nodes configuration with {param_name} {batch_param}")
|
print(f"Update failed for {node} nodes configuration with {param_name} {batch_param}")
|
||||||
break # Skip remaining {param_name} for this node
|
break # Skip remaining {param_name} for this node
|
||||||
@@ -372,36 +378,48 @@ def main(yaml_file, target_node=None, test_mode="oob"):
|
|||||||
os.remove(temp_config_file)
|
os.remove(temp_config_file)
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
# Uninstall the deployment
|
if clean_up:
|
||||||
print(f"\nUninstalling deployment for {node} nodes...")
|
# Uninstall the deployment
|
||||||
cmd = [
|
print(f"\nUninstalling deployment for {node} nodes...")
|
||||||
python_cmd,
|
cmd = [
|
||||||
"deploy.py",
|
python_cmd,
|
||||||
"--chart-name",
|
"deploy.py",
|
||||||
chart_name,
|
"--chart-name",
|
||||||
"--namespace",
|
chart_name,
|
||||||
namespace,
|
"--namespace",
|
||||||
"--uninstall",
|
namespace,
|
||||||
]
|
"--uninstall",
|
||||||
try:
|
]
|
||||||
result = subprocess.run(cmd, check=True)
|
try:
|
||||||
if result.returncode != 0:
|
result = subprocess.run(cmd, check=True)
|
||||||
print(f"Failed to uninstall deployment for {node} nodes")
|
if result.returncode != 0:
|
||||||
except Exception as e:
|
print(f"Failed to uninstall deployment for {node} nodes")
|
||||||
print(f"Error while uninstalling deployment for {node} nodes: {str(e)}")
|
except Exception as e:
|
||||||
|
print(f"Error while uninstalling deployment for {node} nodes: {str(e)}")
|
||||||
|
|
||||||
# Delete labels for current node configuration
|
# Delete labels for current node configuration
|
||||||
print(f"Deleting labels for {node} nodes...")
|
print(f"Deleting labels for {node} nodes...")
|
||||||
cmd = [python_cmd, "deploy.py", "--chart-name", chart_name, "--num-nodes", str(node), "--delete-label"]
|
cmd = [
|
||||||
if current_node_names:
|
python_cmd,
|
||||||
cmd.extend(["--node-names"] + current_node_names)
|
"deploy.py",
|
||||||
|
"--chart-name",
|
||||||
|
chart_name,
|
||||||
|
"--num-nodes",
|
||||||
|
str(node),
|
||||||
|
"--delete-label",
|
||||||
|
]
|
||||||
|
if current_node_names:
|
||||||
|
cmd.extend(["--node-names"] + current_node_names)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = subprocess.run(cmd, check=True)
|
result = subprocess.run(cmd, check=True)
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
print(f"Failed to delete labels for {node} nodes")
|
print(f"Failed to delete labels for {node} nodes")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error while deleting labels for {node} nodes: {str(e)}")
|
print(f"Error while deleting labels for {node} nodes: {str(e)}")
|
||||||
|
else:
|
||||||
|
print("Skipping cleanup for local debug. Manual cleanup may be required.")
|
||||||
|
exit(0)
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"Error processing configuration for {node} nodes: {str(e)}")
|
print(f"Error processing configuration for {node} nodes: {str(e)}")
|
||||||
@@ -419,6 +437,9 @@ if __name__ == "__main__":
|
|||||||
parser.add_argument("yaml_file", help="Path to the YAML configuration file")
|
parser.add_argument("yaml_file", help="Path to the YAML configuration file")
|
||||||
parser.add_argument("--target-node", type=int, help="Optional: Target number of nodes to deploy.", default=None)
|
parser.add_argument("--target-node", type=int, help="Optional: Target number of nodes to deploy.", default=None)
|
||||||
parser.add_argument("--test-mode", type=str, help="Test mode, either 'oob' (out of box) or 'tune'.", default="oob")
|
parser.add_argument("--test-mode", type=str, help="Test mode, either 'oob' (out of box) or 'tune'.", default="oob")
|
||||||
|
parser.add_argument(
|
||||||
|
"--clean-up", type=bool, help="Clean up after test, which can be closed for local debug.", default=True
|
||||||
|
)
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
main(args.yaml_file, args.target_node, args.test_mode)
|
main(args.yaml_file, args.target_node, args.test_mode, args.clean_up)
|
||||||
|
|||||||
Reference in New Issue
Block a user