-
Notifications
You must be signed in to change notification settings - Fork 737
[CI]【Hackathon 10th Spring No.46】Windows build system guards (2/3) #7328
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
daf20d9
6f1e63c
4deb7a7
676daf6
9bcfdca
2bfa878
262c470
171b4d3
def0bd2
4fad5dc
99b9f88
703d557
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 |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| @echo off | ||
| REM Copyright (c) 2025 PaddlePaddle Authors. All Rights Reserved. | ||
| REM | ||
| REM Licensed under the Apache License, Version 2.0 (the "License"); | ||
| REM you may not use this file except in compliance with the License. | ||
| REM You may obtain a copy of the License at | ||
| REM | ||
| REM http://www.apache.org/licenses/LICENSE-2.0 | ||
| REM | ||
| REM Unless required by applicable law or agreed to in writing, software | ||
| REM distributed under the License is distributed on an "AS IS" BASIS, | ||
| REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| REM See the License for the specific language governing permissions and | ||
| REM limitations under the License. | ||
|
|
||
| REM FastDeploy Windows build script | ||
|
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. 🟡 建议 缺少 Python 版本检查
建议添加版本验证以避免兼容性问题。 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. 🟡 建议 缺少帮助信息
建议添加 |
||
| REM Usage: build.bat [BUILD_MODE] [PYTHON] | ||
| REM BUILD_MODE: 0 = build custom ops only, 1 = full build (default) | ||
| REM PYTHON: Python executable (default: python) | ||
| REM | ||
| REM Requires: Visual Studio Build Tools, CUDA Toolkit, Python 3.10+ | ||
| REM Run from a Developer Command Prompt or ensure cl.exe is on PATH. | ||
|
|
||
| setlocal enabledelayedexpansion | ||
|
|
||
| set BUILD_MODE=%~1 | ||
| if "%BUILD_MODE%"=="" set BUILD_MODE=1 | ||
|
|
||
| set PYTHON=%~2 | ||
| if "%PYTHON%"=="" set PYTHON=python | ||
|
|
||
| echo ============================================ | ||
| echo FastDeploy Windows Build | ||
| echo Mode: %BUILD_MODE% (0=ops only, 1=full) | ||
| echo Python: %PYTHON% | ||
| echo ============================================ | ||
|
|
||
| REM Step 1: Build custom ops | ||
| echo. | ||
| echo [1] Building custom ops... | ||
| pushd custom_ops | ||
| %PYTHON% setup_ops.py install | ||
| if !ERRORLEVEL! neq 0 ( | ||
| echo [FAIL] Custom ops build failed. | ||
| popd | ||
| exit /b 1 | ||
| ) | ||
| popd | ||
| echo [OK] Custom ops built successfully. | ||
|
|
||
| if "%BUILD_MODE%"=="0" ( | ||
| echo. | ||
| echo Build complete (ops only). | ||
| exit /b 0 | ||
| ) | ||
|
|
||
| REM Step 2: Build and install FastDeploy wheel | ||
| echo. | ||
| echo [2] Building FastDeploy wheel... | ||
| %PYTHON% setup.py bdist_wheel | ||
| if !ERRORLEVEL! neq 0 ( | ||
| echo [FAIL] Wheel build failed. | ||
| exit /b 1 | ||
| ) | ||
|
|
||
| echo [3] Installing FastDeploy wheel... | ||
| for %%w in (dist\fastdeploy*.whl) do ( | ||
| %PYTHON% -m pip install "%%w" | ||
| if !ERRORLEVEL! neq 0 ( | ||
| echo [FAIL] pip install failed for %%w | ||
| exit /b 1 | ||
| ) | ||
| ) | ||
|
|
||
| echo. | ||
| echo Build complete. | ||
| exit /b 0 | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 建议 缺少关键环境变量传递
build.bat调用setup_ops.py install时没有传递FD_BUILDING_ARCS和FD_CPU_USE_BF16环境变量。与build.sh不一致,Windows 用户无法自定义 CUDA 架构或启用 CPU BF16。建议添加类似
build.sh的环境变量支持。