Files
2125_GCE/xic_extensions/__pycache__/gpu_runtime.cpython-314.pyc
T

45 lines
2.5 KiB
Plaintext
Raw Normal View History

+
”•ãó.Rt^RIHtRRltRRltR#)zäGPU-accelerated compressed execution path for XIC.
has_gpu() probes for CUDA via torch. If torch is absent or no CUDA
device is detected, returns False and run_on_gpu() falls back to CPU
via execute_gx() with a clear log line.
)ÚAnycó$V^8„dQhR\/#)éÚreturn)Úbool)Úformats"Ú2/home/dave/superdave/xic_extensions/gpu_runtime.pyÚ __annotate__r
s÷
ñ
ñ
ócód^RIpVPP4# \dR#i;i)z€Check if CUDA GPU is available via torch.
Returns:
True if torch is installed and CUDA device is detected, False otherwise
NF)ÚtorchÚcudaÚ is_availableÚ ImportError)r s rÚhas_gpur
s/ð ÛØz‰z×(øÜ ôÚðús    /®/có<V^8„dQhR\R\R\/#)rÚ
model_pathÚparamsr)ÚstrÚdictr)rs"rr r s!÷"
ñ"
œ3ð"
¬ð"
´ñ"
r
có˜^RIHp\4'dZ^RIpVPP ^4p\
RV 24V!VVPRR4VPRR4R7#\
R 4V!VVPRR4VPRR4R7# \dp\
RT 24Rp?LRp?ii;i)
a`Execute a .gx model with optional GPU acceleration.
If GPU is available (torch + CUDA), logs device info and runs on GPU.
If GPU is not available, logs fallback and runs on CPU via execute_gx().
Args:
model_path: Path to .gx model file
params: Execution parameters dict (trace, profile, etc.)
Returns:
ExecutionContext from execute_gx()
)Ú
execute_gxNz[XIC-GPU] Device: z.[XIC-GPU] Warning: Could not get device name: ÚtraceFÚprofile)rru-[XIC-GPU] No CUDA device — executing on CPU) Úruntime_executor.runnerrrr r
Úget_device_nameÚprintÚ ExceptionÚget)rrrr Ú device_nameÚes&& rÚ
run_on_gpur!õ‡y‚yð HÛ ØŸ*™*×4°QÓ7ˆ Ð& {  Ø Ø—*‘*˜W eÓ—J‘J˜y¨%Ó
ð
ô ÐØ Ø—*‘*˜W eÓ—J‘J˜y¨%Ó
ð
øôô HÜ ÐBÀ1À#Ð Gûð Hús˜-B&Â& C Â1CÃC N)Ú__doc__Útypingrrr!©r