-
Notifications
You must be signed in to change notification settings - Fork 743
[FDConfig] 默认开启 FD_ENABLE_E2W_TENSOR_CONVERT 和 FD_ENGINE_TASK_QUEUE_WITH_SHM #7746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -95,13 +95,14 @@ def llm(model_path): | |
| ) | ||
|
|
||
| # Wait for the port to be open | ||
| wait_start = time.time() | ||
| while not is_port_open("127.0.0.1", FD_ENGINE_QUEUE_PORT): | ||
| if time.time() - wait_start > MAX_WAIT_SECONDS: | ||
| pytest.fail( | ||
| f"Model engine did not start within {MAX_WAIT_SECONDS} seconds on port {FD_ENGINE_QUEUE_PORT}" | ||
| ) | ||
| time.sleep(1) | ||
| time.sleep(2) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 建议 用 当 建议补充适合 SHM 模式的就绪检测机制(如轮询 SHM 文件/信号量是否创建),或至少延长等待时间并加 MAX_WAIT_SECONDS 超时保护,并在注释中说明为何旧的端口检查不再适用: # SHM 模式下引擎不监听 TCP 端口,改为等待 SHM 就绪
wait_start = time.time()
while not shm_is_ready(): # 补充 SHM 就绪检测
if time.time() - wait_start > MAX_WAIT_SECONDS:
pytest.fail(f"Engine did not start within {MAX_WAIT_SECONDS}s")
time.sleep(1)如果暂时没有可用的 SHM 就绪探针,建议将 |
||
| # wait_start = time.time() | ||
| # while not is_port_open("127.0.0.1", FD_ENGINE_QUEUE_PORT): | ||
| # if time.time() - wait_start > MAX_WAIT_SECONDS: | ||
| # pytest.fail( | ||
| # f"Model engine did not start within {MAX_WAIT_SECONDS} seconds on port {FD_ENGINE_QUEUE_PORT}" | ||
| # ) | ||
| # time.sleep(1) | ||
|
|
||
| print(f"Model loaded successfully from {model_path} in {time.time() - start:.2f}s.") | ||
| yield llm | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,6 +117,13 @@ def clean_ports(ports=None): | |
| kill_process_on_port(port) | ||
| time.sleep(1) | ||
|
|
||
| # 清理/dev/shm中的临时文件 | ||
| try: | ||
| subprocess.run("rm -rf /dev/shm/*", shell=True) | ||
This comment was marked as outdated.
Sorry, something went wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ❓ 疑问
建议添加显式检查 returncode: try:
result = subprocess.run("rm -rf /dev/shm/*", shell=True)
if result.returncode != 0:
print(f"Warning: /dev/shm cleanup returned code {result.returncode}")
else:
print("Successfully cleaned up /dev/shm.")
except Exception as e:
print(f"Failed to cleanup /dev/shm: {e}") |
||
| print("Successfully cleaned up /dev/shm.") | ||
| except Exception as e: | ||
| print(f"Failed to cleanup /dev/shm: {e}") | ||
|
|
||
|
|
||
| def clean(ports=None): | ||
| """ | ||
|
|
||
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.