Skip to content

[feature]add fd whl version info #2698

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

Merged
merged 2 commits into from
Jul 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,21 @@ function build_and_install() {
cd ..
}

function version_info() {
output_file="fastdeploy/version.txt"
fastdeploy_git_commit_id=$(git rev-parse HEAD)
paddle_version=$(${python} -c "import paddle; print(paddle.__version__)")
paddle_git_commit_id=$(${python} -c "import paddle; print(paddle.version.show())" | grep -Po "(?<=commit: )[\da-f]+")
cuda_version=$(nvcc -V | grep -Po "(?<=release )[\d.]+(?=, V)")
cxx_version=$(g++ --version | head -n 1 | grep -Po "(?<=\) )[\d.]+")

echo "fastdeploy GIT COMMIT ID: $fastdeploy_git_commit_id" > $output_file
echo "Paddle version: $paddle_version" >> $output_file
echo "Paddle GIT COMMIT ID: $paddle_git_commit_id" >> $output_file
echo "CUDA version: $cuda_version" >> $output_file
echo "CXX compiler version: $cxx_version" >> $output_file
}

function cleanup() {
rm -rf $BUILD_DIR $EGG_DIR
if [ `${python} -m pip list | grep fastdeploy | wc -l` -gt 0 ]; then
Expand Down Expand Up @@ -207,6 +222,7 @@ if [ "$BUILD_WHEEL" -eq 1 ]; then
set -e

init
version_info
build_and_install_ops
build_and_install
cleanup
Expand Down Expand Up @@ -237,6 +253,7 @@ if [ "$BUILD_WHEEL" -eq 1 ]; then
else
init
build_and_install_ops
version_info
rm -rf $BUILD_DIR $EGG_DIR $DIST_DIR
rm -rf $OPS_SRC_DIR/$BUILD_DIR $OPS_SRC_DIR/$EGG_DIR
fi
1 change: 1 addition & 0 deletions fastdeploy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
os.environ["GLOG_minloglevel"] = "2"
# suppress log from aistudio
os.environ["AISTUDIO_LOG"] = "critical"
from fastdeploy.utils import version
from fastdeploy.engine.sampling_params import SamplingParams
from fastdeploy.entrypoints.llm import LLM

Expand Down
13 changes: 13 additions & 0 deletions fastdeploy/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,19 @@ def is_list_of(

assert_never(check)

def version():
"""
Prints the contents of the version.txt file located in the parent directory of this script.
"""
current_dir = os.path.dirname(os.path.abspath(__file__))
version_file_path = os.path.join(current_dir, 'version.txt')

try:
with open(version_file_path, 'r') as f:
content = f.read()
print(content)
except FileNotFoundError:
llm_logger.error("[version.txt] Not Found!")

llm_logger = get_logger("fastdeploy", "fastdeploy.log")
data_processor_logger = get_logger("data_processor", "data_processor.log")
Expand Down
200 changes: 0 additions & 200 deletions scripts/build_wheel_pipeline_cu123.sh

This file was deleted.

3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ def get_name():
"model_executor/ops/xpu/libs/*",
"model_executor/ops/npu/*", "model_executor/ops/base/*",
"model_executor/models/*", "model_executor/layers/*",
"input/mm_processor/utils/*"
"input/mm_processor/utils/*",
"version.txt"
]
},
install_requires=load_requirements(),
Expand Down