forked from intel/ipex-llm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add example test scripts for orca.automl (intel#4836)
- Loading branch information
1 parent
1b448eb
commit 4ed1ea7
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#!/usr/bin/env bash | ||
clear_up () { | ||
echo "Clearing up environment. Uninstalling BigDL" | ||
pip uninstall -y bigdl-orca | ||
pip uninstall -y bigdl-dllib | ||
pip uninstall -y pyspark | ||
} | ||
|
||
execute_ray_test(){ | ||
echo "start example $1" | ||
start=$(date "+%s") | ||
python $2 | ||
exit_status=$? | ||
if [ $exit_status -ne 0 ]; | ||
then | ||
clear_up | ||
echo "$1 failed" | ||
exit $exit_status | ||
fi | ||
now=$(date "+%s") | ||
return $((now-start)) | ||
} | ||
|
||
execute_ray_test auto-estimator-pytorch "${BIGDL_ROOT}/python/orca/example/automl/autoestimator/autoestimator_pytorch.py --trials 5 --epochs 2" | ||
time1=$? | ||
|
||
if [ -f ${BIGDL_ROOT}/data/airline_14col.data ] | ||
then | ||
echo "airline_14col.data already exists" | ||
else | ||
wget -nv $FTP_URI/analytics-zoo-data/airline_14col.data -P ${BIGDL_ROOT}/data/ | ||
fi | ||
|
||
execute_ray_test auto-xgboost-classifier "${BIGDL_ROOT}/python/orca/example/automl/autoxgboost/AutoXGBoostClassifier.py -p ${BIGDL_ROOT}/data/airline_14col.data" | ||
time2=$? | ||
|
||
if [ -f ${BIGDL_ROOT}/data/incd.csv ] | ||
then | ||
echo "incd.csv already exists" | ||
else | ||
wget -nv $FTP_URI/analytics-zoo-data/incd.csv -P ${BIGDL_ROOT}/data/ | ||
fi | ||
|
||
execute_ray_test auto-xgboost-regressor "${BIGDL_ROOT}/python/orca/example/automl/autoxgboost/AutoXGBoostRegressor.py -p ${BIGDL_ROOT}/data/incd.csv" | ||
time3=$? | ||
|
||
echo "#1 auto-estimator-pytorch time used:$time1 seconds" | ||
echo "#2 auto-xgboost-classifier time used:$time2 seconds" | ||
echo "#3 auto-xgboost-regressor time used:$time3 seconds" | ||
|
||
clear_up |