Initial marker-api benchmark setup: Containerfile, app.py, convert_both.py, compare_conversions.py

This commit is contained in:
oval
2026-06-05 13:26:25 +02:00
commit 460fc0003b
33 changed files with 58290 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# ===== entrypoint.sh =====
# Starts any pre-flight checks then exec's the CMD
set -euo pipefail
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH:-}:/opt/rocm/lib"
# Apply AMD/ROCm env overrides before anything loads torch
if [[ "${AMD_COMPUTE:-false}" == "true" ]]; then
export TORCH_DEVICE="${TORCH_DEVICE:-cuda}"
export TORCH_DEVICE_MODEL="${TORCH_DEVICE:-cuda}"
echo "[entrypoint] AMD compute enabled, TORCH_DEVICE=${TORCH_DEVICE}"
fi
# Check torch/ROCm availability
python3 -c "import torch; dev=torch.device('cuda' if torch.cuda.is_available() else 'cpu'); print(f'[entrypoint] PyTorch device: {dev}, ROCm: {torch.version.rocm if hasattr(torch.version, \"rocm\") else \"n/a\"}')" 2>&1
echo "[entrypoint] Starting marker-api on ${HOST:-0.0.0.0}:${PORT:-8000} ..."
exec "$@"