Spaces:
Runtime error
Runtime error
meg-huggingface
commited on
Commit
·
005d6f3
1
Parent(s):
a10615a
Trying to get rid of the error on app not initializing and updating the EnergyStarAI to AIEnergyScore
Browse files- Dockerfile +1 -1
- create_results.py +3 -3
- entrypoint.sh +4 -2
- failed_run.py +2 -2
- upload_run_folder.py +1 -1
Dockerfile
CHANGED
|
@@ -76,4 +76,4 @@ RUN --mount=type=secret,id=DEBUG,mode=0444,required=true \
|
|
| 76 |
git init && \
|
| 77 |
git remote add origin $(cat /run/secrets/DEBUG)
|
| 78 |
|
| 79 |
-
|
|
|
|
| 76 |
git init && \
|
| 77 |
git remote add origin $(cat /run/secrets/DEBUG)
|
| 78 |
|
| 79 |
+
CMD ["/entrypoint.sh"]
|
create_results.py
CHANGED
|
@@ -13,12 +13,12 @@ out_dir = sys.argv[1]
|
|
| 13 |
#Uploading results
|
| 14 |
api.upload_folder(
|
| 15 |
folder_path=out_dir,
|
| 16 |
-
repo_id="
|
| 17 |
repo_type="dataset",
|
| 18 |
)
|
| 19 |
|
| 20 |
#Updating requests
|
| 21 |
-
requests = load_dataset("
|
| 22 |
requests_dset = requests.to_pandas()
|
| 23 |
|
| 24 |
models_ran=[]
|
|
@@ -33,5 +33,5 @@ print("Models ran are: " + str(models_ran))
|
|
| 33 |
|
| 34 |
requests_dset.loc[requests_dset["model"].isin(models_ran), ['status']] = "COMPLETED"
|
| 35 |
updated_dset =Dataset.from_pandas(requests_dset)
|
| 36 |
-
updated_dset.push_to_hub("
|
| 37 |
print("Updated model status")
|
|
|
|
| 13 |
#Uploading results
|
| 14 |
api.upload_folder(
|
| 15 |
folder_path=out_dir,
|
| 16 |
+
repo_id="AIEnergyScore/results_debug",
|
| 17 |
repo_type="dataset",
|
| 18 |
)
|
| 19 |
|
| 20 |
#Updating requests
|
| 21 |
+
requests = load_dataset("AIEnergyScore/requests_debug", split="test", token=TOKEN)
|
| 22 |
requests_dset = requests.to_pandas()
|
| 23 |
|
| 24 |
models_ran=[]
|
|
|
|
| 33 |
|
| 34 |
requests_dset.loc[requests_dset["model"].isin(models_ran), ['status']] = "COMPLETED"
|
| 35 |
updated_dset =Dataset.from_pandas(requests_dset)
|
| 36 |
+
updated_dset.push_to_hub("AIEnergyScore/requests_debug", split="test", token=TOKEN)
|
| 37 |
print("Updated model status")
|
entrypoint.sh
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
-
export SPACE="
|
| 4 |
|
| 5 |
echo "Not checking h100 -- already know it's not there."
|
| 6 |
#python /check_h100.py
|
|
@@ -19,7 +19,9 @@ python /parse_requests.py | while read -r line; do
|
|
| 19 |
mkdir -p "$run_dir"
|
| 20 |
|
| 21 |
# Let the benchmarking begin!
|
| 22 |
-
optimum-benchmark --config-name "${experiment_name}" --config-dir /optimum-benchmark/examples/energy_star/ backend.model="${backend_model}" backend.processor="${backend_model}" hydra.run.dir="${run_dir}" 2> "${run_dir}/error.log" ||
|
|
|
|
|
|
|
| 23 |
done
|
| 24 |
|
| 25 |
echo "Finished; uploading dataset results"
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
|
| 3 |
+
export SPACE="AIEnergyScore/launch-computation-example"
|
| 4 |
|
| 5 |
echo "Not checking h100 -- already know it's not there."
|
| 6 |
#python /check_h100.py
|
|
|
|
| 19 |
mkdir -p "$run_dir"
|
| 20 |
|
| 21 |
# Let the benchmarking begin!
|
| 22 |
+
optimum-benchmark --config-name "${experiment_name}" --config-dir /optimum-benchmark/examples/energy_star/ backend.model="${backend_model}" backend.processor="${backend_model}" hydra.run.dir="${run_dir}" 2> "${run_dir}/error.log" ||
|
| 23 |
+
# If the benchmark fails, update accordingly. Remove the run directory for that specific model.
|
| 24 |
+
(python /failed_run.py --run_dir "${run_dir}" --model_name "${backend_model}" && rm -rf $run_dir)
|
| 25 |
done
|
| 26 |
|
| 27 |
echo "Finished; uploading dataset results"
|
failed_run.py
CHANGED
|
@@ -27,7 +27,7 @@ parser.add_argument(
|
|
| 27 |
args = parser.parse_args()
|
| 28 |
|
| 29 |
# Updating request
|
| 30 |
-
dataset = load_dataset("
|
| 31 |
|
| 32 |
# Set benchmark to failed
|
| 33 |
# TODO: This doesn't have to be try-except, we could actually check if the file is there.
|
|
@@ -46,4 +46,4 @@ except FileNotFoundError as e:
|
|
| 46 |
print(f"Could not find {args.run_dir}/error.log")
|
| 47 |
|
| 48 |
updated_dataset = Dataset.from_pandas(dataset)
|
| 49 |
-
updated_dataset.push_to_hub("
|
|
|
|
| 27 |
args = parser.parse_args()
|
| 28 |
|
| 29 |
# Updating request
|
| 30 |
+
dataset = load_dataset("AIEnergyScore/requests_debug", split="test", token=TOKEN).to_pandas()
|
| 31 |
|
| 32 |
# Set benchmark to failed
|
| 33 |
# TODO: This doesn't have to be try-except, we could actually check if the file is there.
|
|
|
|
| 46 |
print(f"Could not find {args.run_dir}/error.log")
|
| 47 |
|
| 48 |
updated_dataset = Dataset.from_pandas(dataset)
|
| 49 |
+
updated_dataset.push_to_hub("AIEnergyScore/requests_debug", split="test", token=TOKEN)
|
upload_run_folder.py
CHANGED
|
@@ -20,7 +20,7 @@ try:
|
|
| 20 |
api.upload_folder(
|
| 21 |
folder_path=args.run_dir,
|
| 22 |
path_in_repo=args.run_dir,
|
| 23 |
-
repo_id="
|
| 24 |
repo_type="dataset",
|
| 25 |
)
|
| 26 |
except Exception as e:
|
|
|
|
| 20 |
api.upload_folder(
|
| 21 |
folder_path=args.run_dir,
|
| 22 |
path_in_repo=args.run_dir,
|
| 23 |
+
repo_id="AIEnergyScore/backend_runs_directory",
|
| 24 |
repo_type="dataset",
|
| 25 |
)
|
| 26 |
except Exception as e:
|