This file contains hidden or 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
import torch | |
from torch.nn.functional import scaled_dot_product_attention | |
from torch.nn.attention import SDPBackend, sdpa_kernel | |
import time | |
import argparse | |
import sys | |
# --- XPU Device Setup (Strictly XPU) --- | |
DEVICE = "xpu" | |
# Check if torch.xpu is available, which is necessary for the XPU-specific code. |
This file contains hidden or 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
import contextlib | |
import os | |
import time | |
import sys | |
import torch | |
from diffusers import DPMSolverMultistepScheduler, StableDiffusionPipeline, StableDiffusionImg2ImgPipeline, StableDiffusionXLPipeline, StableDiffusion3Pipeline | |
import argparse | |
import numpy as np | |
from PIL import Image | |
import pytorch_fid |
This file contains hidden or 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
#!/usr/bin/env bash | |
set -eEuo pipefail | |
MARKER_FILE_NAME="${DOCKER_PRUNER_MARKER:-DOCKER-PRUNER-MARKER-FILE}" | |
DOCKER_PATH="${DOCKER_PATH:-/var/lib/docker/overlay2}" | |
function _used_dirs() { | |
for docker_obj in $(docker ps -aq) $(docker image ls -aq); do | |
lowerdir="$(docker inspect "$docker_obj" | jq '.[].GraphDriver.Data.LowerDir' -r)" |
This file contains hidden or 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
diff --git a/detect.py b/detect.py | |
index 8feb07d..d65f3f3 100644 | |
--- a/detect.py | |
+++ b/detect.py | |
@@ -74,6 +74,13 @@ def run( | |
hide_conf=False, # hide confidences | |
half=False, # use FP16 half-precision inference | |
dnn=False, # use OpenCV DNN for ONNX inference | |
+ precision="bfloat16", | |
+ channels_last=1, |
This file contains hidden or 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
# syntax=docker/dockerfile:1 | |
ARG BASE_IMAGE=ubuntu:20.04 | |
FROM ${BASE_IMAGE} AS dev-base | |
RUN apt-get update && \ | |
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ | |
build-essential \ | |
ca-certificates \ | |
ccache \ | |
cmake \ | |
curl \ |
This file contains hidden or 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
# syntax=docker/dockerfile:1 | |
ARG BASE_IMAGE=ubuntu:20.04 | |
FROM ${BASE_IMAGE} AS dev-base | |
RUN apt-get update && \ | |
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ | |
build-essential \ | |
ca-certificates \ | |
ccache \ | |
cmake \ | |
curl \ |
This file contains hidden or 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
# syntax=docker/dockerfile:1 | |
ARG BASE_IMAGE=ubuntu:20.04 | |
FROM ${BASE_IMAGE} AS dev-base | |
RUN apt-get update && \ | |
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ | |
build-essential \ | |
ca-certificates \ | |
ccache \ | |
cmake \ | |
curl \ |