+
    ÆÜ³jC  ã                   óÎ  € ^ RI t^ RIt^ RIt^ RIt^ RIHt ^ RIt^ RIH	t	 ^ RI
t
^ RIHtHt ^ RIHtHtHtHt ]P&                  ! ]4      tR R lt ! R R	4      t ! R
 R]4      t ! R R]4      tR R ltR R ltR R ltR R lt ! R R]4      tR R ltR R lt ]! 4       t!Rt"Rt#]
PH                  PJ                  '       d   Rt"Rt#MA]
PL                  PO                  4       '       d   R t#M]
PP                  PR                  '       d   R!t# ] ! 4       t*R#   ]+ dG   t,]#R%9   d   ]! R"4      t* Rt,A,R# ]-! ],4      t.]P_                  R#]. 2RR$7       ]! ].4      t* Rt,A,R# Rt,A,ii ; i)&é    N©ÚPath)ÚOptional)ÚDYNAMIC_LIBRARY_SUFFIXÚPACKAGE_DIR)Ú	CUDASpecsÚget_cuda_specsÚget_cuda_version_tupleÚget_rocm_gpu_archc                ó0   € V ^8„  d   QhR\         R\        /# )é   Ú
cuda_specsÚreturn)r   r   )Úformats   "ÚX/home/luca/screen-checking/.venv/lib/python3.14/site-packages/bitsandbytes/cextension.pyÚ__annotate__r      s   € ÷ :ñ :¬)ð :¼ñ :ó    c                óh  € \        \        P                  P                  4      pV'       d   RMRpV'       d   RMRp\        P
                  P                  V4      pVer   VP                  4       '       g   \        V RV: R24      hRV V \         2p\        P                  RT RT R	T R
V'       d   RMR RV R24       \        V,          # \        W!4      pV P                  pV'       g#   \        RV V P                   \         2,          # Wv9   d	   Wg,          # V Uu. uF#  qˆ^ ,          V^ ,          8X  g   K  W‡8  g   K!  VNK%  	  p	pV	'       d   \!        V	4      p
MeV Uu. uF#  qˆ^ ,          V^ ,          8X  g   K  W‡8”  g   K!  VNK%  	  ppV'       d   \#        V4      p
M"\        RV V P                   \         2,          # \        P                  RV'       d   RMR RV^ ,           RV^,           RV'       d   RMR RV
^ ,           RV
^,           RV R24       Wj,          # u upi u upi )a  
Get the path to the best matching CUDA/ROCm BNB native library for the given specs.

When no override is set, selects from packaged libraries using the following priority:
1. Exact version match.
2. Highest packaged version <= runtime version, same major (e.g. runtime 12.9, ship 12.8).
3. Lowest packaged version > runtime version, same major (e.g. runtime 12.0, ship 12.1).
No cross-major fallback: if no same-major library exists, returns the exact non-existent
path so the caller raises a clear "not found" error.
A warning is logged when falling back. Override env vars bypass selection entirely
and load the named version with no fallback. The returned path is not guaranteed to
exist when no packaged libs are found, or when an override names an absent version.
ÚrocmÚcudaÚBNB_ROCM_VERSIONÚBNB_CUDA_VERSIONÚ=z2: value must be digits only (e.g. '124' for 12.4).Úlibbitsandbytes_z	WARNING: z( environment variable detected; loading z.
This overrides automatic ÚROCmÚCUDAzO version selection.
If this was unintended clear the variable and retry: unset Ú
zNo prebuilt binary for Ú Ú.z
, loading z instead. Set z to override.)ÚboolÚtorchÚversionÚhipÚosÚenvironÚgetÚisdigitÚRuntimeErrorr   ÚloggerÚwarningr   Ú_find_cuda_libsÚcuda_version_tupleÚcuda_version_stringÚmaxÚmin)r   Úis_hipÚprefixÚoverride_varÚoverride_valueÚlibrary_nameÚ	availableÚruntime_versionÚvÚlowerÚselectedÚhigher_sames   &           r   Úget_cuda_bnb_library_pathr;      s3  € ô ”%—-‘-×#Ñ#Ó$€Fß‰V 6€Fß)/Ñ%Ð5G€Lä—Z‘Z—^‘^ LÓ1€NàÒ!Ø×%Ñ%×'Ò'Ü , ¨q°Ñ0BÐBtÐuÓvÐvØ)¨&¨°.Ð1AÔBXÐAYÐZˆÜ�‰Ø˜�~ Q ~Ð&6Ð6^Ð_kÐ^lð m(ß28©¸fÐ'Eð FJØJVÈÐWYð[ô	
ô
 ˜\Õ)Ð)ä Ó/€IØ ×3Ñ3€OçÜÐ/°¨x¸
×8VÑ8VÐ7WÔXnÐWoÐpÕpÐpàÔ#ØÕ)Ð)á!ÓX™	�1 q¥T¨_¸QÕ-?Ñ%?ŒQÀAÑDW�QˆQ™	€EÐXßÜ�u“:‰á"+Ób¡)˜Q°­t°ÀqÕ7IÑ/I”qÈaÑNa—q�q¡)ˆÐbßÜ˜;Ó'‰Hô Ð#3°F°8¸J×<ZÑ<ZÐ;[Ô\rÐ[sÐ!tÕtÐtä
‡N�NØ
!¯F¡&¸Ð!?¸qØ˜1ÕÐ
˜a °Õ 2Ð3°:ß‰6 Ð
(¨¨(°1­+¨°a¸À½°}ð EØˆn˜Mð	+ôð ÕÐùò% Yùò cs$   Ä#H*Ä>H*ÅH*Å&H/ÆH/Æ	H/c                   ól   a € ] tR t^St o RtV 3R lR lt]P                  R 4       tR t	V 3R lt
RtV tR# )	ÚBNBNativeLibraryFc                ó4   <€ V ^8„  d   QhRS[ P                  /# ©r   Úlib©ÚctÚCDLL)r   Ú__classdict__s   "€r   r   ÚBNBNativeLibrary.__annotate__W   s   ø€ ÷ ñ ™BŸG™Gñ r   c                ó   € Wn         R # ©N©Ú_lib)Úselfr@   s   &&r   Ú__init__ÚBNBNativeLibrary.__init__W   s   € ØŽ	r   c                óN   a€ \        V P                  SR 4      pVe   V# V3R lpV# )Nc                  ó"   <€ \        R S R24      h)zMethod 'zm' not available in CPU-only version of bitsandbytes.
Reinstall with GPU support or use CUDA-enabled hardware.)r(   )ÚargsÚkwargsÚnames   *,€r   Úthrow_on_callÚ3BNBNativeLibrary.__getattr__.<locals>.throw_on_calla   s#   ø€ ÜØ˜4˜&ð !Kð Kóð r   )ÚgetattrrI   )rJ   rQ   ÚfnrR   s   &f  r   Ú__getattr__ÚBNBNativeLibrary.__getattr__Z   s,   ø€ ä�T—Y‘Y  dÓ+ˆàŠ>ØˆIõ	ð Ðr   c                ó$   € V P                  V4      # rG   ©rV   )rJ   Úitems   &&r   Ú__getitem__ÚBNBNativeLibrary.__getitem__i   ó   € Ø×Ñ Ó%Ð%r   c                ó:   <€ V ^8„  d   Qh/ S[ P                  ;R&   # )r   rI   rA   )r   rD   s   "€r   r   rE   S   s   ø‡ ‚ Ù
�'‰'�Mò r   rH   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Úcompiled_with_cudarK   Ú	functoolsÚcacherV   r[   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__©rD   s   @r   r=   r=   S   s9   ø‡ € àÐ÷ð ð ‡_�_ñó ðò&÷- ƒ r   r=   c                   óB   a a€ ] tR t^mt oRtV3R lV 3R lltRtVtV ;t# )ÚCudaBNBNativeLibraryTc                ó4   <€ V ^8„  d   QhRS[ P                  /# r?   rA   )r   rD   s   "€r   r   Ú!CudaBNBNativeLibrary.__annotate__p   s   ø€ ÷ 3ñ 3™BŸG™Gñ 3r   c                ó¢   <€ \         SV `  V4       \        P                  VP                  n        \        P                  VP                  n        R # rG   )ÚsuperrK   rB   Úc_void_pÚget_contextÚrestypeÚcget_managed_ptr©rJ   r@   Ú	__class__s   &&€r   rK   ÚCudaBNBNativeLibrary.__init__p   s2   ø€ Ü‰Ñ˜ÔÜ"$§+¡+ˆ�‰ÔÜ')§{¡{ˆ×ÑÖ$r   © )	r_   r`   ra   rb   rc   rK   rg   rh   Ú__classcell__©ru   rD   s   @@r   rk   rk   m   s   ù‡ € ØÐ÷3÷ 3ó 3r   rk   c                   óB   a a€ ] tR t^vt oRtV3R lV 3R lltRtVtV ;t# )ÚXpuBNBNativeLibraryz6XPU native library with SYCL USM paged memory support.c                ó4   <€ V ^8„  d   QhRS[ P                  /# r?   rA   )r   rD   s   "€r   r   Ú XpuBNBNativeLibrary.__annotate__y   s   ø€ ÷ 7ñ 7™BŸG™Gñ 7r   c                óŒ   <€ \         SV `  V4       \        VR 4      '       d"   \        P                  VP
                  n        R# R# )rs   N)ro   rK   ÚhasattrrB   rp   rs   rr   rt   s   &&€r   rK   ÚXpuBNBNativeLibrary.__init__y   s5   ø€ Ü‰Ñ˜ÔÜ�3Ð*×+Ò+Ü+-¯;©;ˆC× Ñ Ö(ñ ,r   rw   )	r_   r`   ra   rb   Ú__doc__rK   rg   rh   rx   ry   s   @@r   r{   r{   v   s   ù‡ € Ù@÷7÷ 7ó 7r   r{   c                ó^   € V ^8„  d   QhR\         R\        R\        \        \        3,          /# )r   Úcompactr0   r   )Ústrr    ÚtupleÚint)r   s   "r   r   r      s)   € ÷ 	.ñ 	.¤ð 	.¬dð 	.´u¼SÄ#¸Xµñ 	.r   c                ó¢   € V'       d%   \        V R,          4      \        V R,          4      3# \        V R,          4      \        V R,          4      3# )a0  Split a compact CUDA/ROCm version string from a library filename into (major, minor).

CUDA: major is always 2 digits (11, 12, 13...), e.g. '118' -> (11, 8), '132' -> (13, 2).
ROCm: major is always 1 digit for now (6, 7...), e.g. '72' -> (7, 2), '713' -> (7, 13).
Note: revisit if ROCm major reaches 10.
:Né   N:rˆ   NN:Nr   N:r   NN)r†   )rƒ   r0   s   &&r   Ú_split_cuda_versionr‰      sA   € ÷ Ü�7˜2•;Ó¤ W¨R¥[Ó!1Ð1Ð1Üˆw�r�{ÓœS ¨¥Ó-Ð-Ð-r   c          	      ó€   € V ^8„  d   QhR\         R\        R\        \        \        \        3,          \
        3,          /# )r   r1   r0   r   )r„   r    Údictr…   r†   r   )r   s   "r   r   r   ‹   s3   € ÷ 
ñ 
œCð 
¬ð 
´$´u¼SÄ#¸XµÌÐ7LÕ2Mñ 
r   c                ó   € / p\         P                  ! RV  R\         24       FO  p\        P                  ! V  R2VP
                  4      pV'       g   K1   W2\        VP                  ^4      V4      &   KQ  	  V#   \        \        3 d     Ki  i ; i)zQReturn a {(major, minor): Path} mapping for all packaged CUDA/ROCm library files.r   Ú*z(\d+))
r   Úglobr   ÚreÚsearchrQ   r‰   ÚgroupÚ
ValueErrorÚ
IndexError)r1   r0   Úresultr@   Úmatchs   &&   r   r+   r+   ‹   sŠ   € à€FÜ×ÒÐ"2°6°(¸!Ô<RÐ;SÐ TÖUˆÜ—	’	˜f˜X UÐ+¨S¯X©XÓ6ˆß‰5ðØFIÔ*¨5¯;©;°q«>¸6ÓBÓCñ	 Vð €Møô ¤
Ð+ô Úðús   ÁA8Á8BÂBc                ó:   € V ^8„  d   QhR\         \        ,          /# ©r   r   )Úlistr„   )r   s   "r   r   r   ˜   s   € ÷ Zñ Z¬D´­Iñ Zr   c                 ó–   € \        \        P                  P                  4      p V '       d   RMRp\	        R \        W4       4       4      # )z=Get formatted CUDA/ROCm versions from existing library files.r   r   c              3   ó4   "  € T F  w  rV R V 2x € K  	  R# 5i)r   Nrw   )Ú.0ÚmajorÚminors   &  r   Ú	<genexpr>Ú5get_available_cuda_binary_versions.<locals>.<genexpr>œ   s   é € ÐYÑ9X©¨�U�G˜1˜U˜GÕ$Ó9Xùs   ‚)r    r!   r"   r#   Úsortedr+   )r0   r1   s     r   Ú"get_available_cuda_binary_versionsr¡   ˜   s5   € ä”%—-‘-×#Ñ#Ó$€Fß‰V 6€FÜÑY¼ÈÔ9XÓYÓYÐYr   c                ó0   € V ^8„  d   QhR\         R\         /# )r   Úversion_strr   ©r„   )r   s   "r   r   r   Ÿ   s   € ÷ 	ñ 	¤Cð 	¬Cñ 	r   c                óÒ   € V P                  4       '       d9   \        \        P                  P                  4      p \        W4      w  r#V RV 2# V #   \        \        3 d     T # i ; i)z`Convert a raw version code string (e.g. '118', '713') to a dotted version (e.g. '11.8', '7.13').r   )r'   r    r!   r"   r#   r‰   r’   r“   )r£   r0   rœ   r�   s   &   r   Úparse_cuda_versionr¦   Ÿ   sn   € à×Ñ×ÒÜ”e—m‘m×'Ñ'Ó(ˆð	Ü.¨{ÓC‰LˆEØ�W˜A˜e˜WÐ%Ð%ð Ðøô œJÐ'ô 	ØØÐð	ús   »A ÁA&Á%A&c                   ój   a € ] tR t^«t o RtV 3R lR ltRV 3R lR lltV 3R lR ltR	 tR
 t	Rt
V tR# )Ú ErrorHandlerMockBNBNativeLibraryaá  
Mock library handler that defers errors until native methods are called.

This class serves as a fallback when the native bitsandbytes library fails to load.
It captures the original error and generates detailed troubleshooting guidance.

Key behaviors:
- Allows attribute access and method assignment without immediate errors
- Throws a RuntimeError with diagnostic information only when a native method is called, as otherwise it would error out on import, breaking backward compatibility
- Handles both missing CUDA dependencies and version mismatch scenarios

Error scenarios covered:
1. Missing shared library dependencies (e.g., libcudart.so not in LD_LIBRARY_PATH or through PyTorch CUDA installation)
2. CUDA version mismatch between PyTorch and available pre-compiled binaries
3. Completely missing pre-compiled binaries when CUDA is detected
4. Custom BNB_CUDA_VERSION or BNB_ROCM_VERSION override but mismatch
5. CPU-only installation attempts when GPU functionality is requested

c                ó    <€ V ^8„  d   QhRS[ /# )r   Ú	error_msgr¤   )r   rD   s   "€r   r   Ú-ErrorHandlerMockBNBNativeLibrary.__annotate__À   s   ø€ ÷ ñ ¡#ñ r   c                ó&  € Wn         \        4       V n        \        '       d    \        P
                  P                  R 4      M\        P
                  P                  R4      p\        4       pV'       d   V^ ,           RV^,           2MRpV'       d   \        V4      MTV n	        RV9   d   V P                  4       V n        R	# T P                  V P                  TV P                   '       d   RV P                    R2MRV P                  R7      V n        R	# )
r   r   r   Úunknownzcannot open shared object filezOriginal error: r   Ú )Úavailable_versionsÚuser_cuda_versionÚoriginal_errorÚrequested_versionN)rª   r¡   r¯   ÚHIP_ENVIRONMENTr$   r%   r&   r
   r¦   r²   Ú_format_dependency_errorÚformatted_errorÚ_format_lib_error_message)rJ   rª   r3   Úuser_versionÚuser_version_strs   &&   r   rK   Ú)ErrorHandlerMockBNBNativeLibrary.__init__À   sß   € Ø"ŒÜ"DÓ"FˆÔß?N»œŸ™Ÿ™Ð(:Ô;ÔTV×T^ÑT^×TbÑTbÐcuÓTvˆÜ-Ó/ˆßEQ˜l¨1�oÐ.¨a°¸QµÐ/@ÑAÐW`ÐßGUÔ!3°NÔ!CÐ[kˆÔð ,¨yÔ8Ø#'×#@Ñ#@Ó#BˆDÖ à#'×#AÑ#AØ#'×#:Ñ#:Ø"2ØHLÏÏÈÐ!1°$·.±.Ð1AÀÑDÐ\^Ø"&×"8Ñ"8ð	 $Bó $ˆDÖ r   Nc          
      óX   <€ V ^8„  d   QhRS[ S[,          RS[RS[RS[S[,          RS[/# )r   r¯   r°   r±   r²   r   )r˜   r„   r   )r   rD   s   "€r   r   r«   Ó   sS   ø€ ÷ Qsñ Qsá ¡�IðQsñ ðQsñ ð	Qsñ
 $¡C�=ðQsñ 
ñQsr   c                óà  € RpRV9   p\          R2V9   pV'       d   RpMUV'       dN   V'       d   RRP                  V4      ,           MRpV'       d"   R\          R\          R	V R
\          RV RV R2MRpRp	V'       d   R\          R2M	R\          R2p
V'       d   R\          R\          R2MRpV'       g   RM\        '       g   RMRpR\         P                  4        R2pV V	 V
 V V V RV 2# )z:Format detailed error message for library loading failuresr®   z#libbitsandbytes_cpu.so: cannot openz binary not foundu9   
ðŸš¨ Failed to load CPU-only bitsandbytes library ðŸš¨

z
  - ÚNONEõ   
ðŸš¨ u!    VERSION MISMATCH ðŸš¨
Requested z version:          z
Detected PyTorch z version:   z"
Available pre-compiled versions: zU

This means:
The version you're trying to use is NOT distributed with this package

u˜   
ðŸš¨ Forgot to compile the bitsandbytes library? ðŸš¨
1. You're not using the package but checked-out the source code
2. You MUST compile from source

zTAttempted to use bitsandbytes native library functionality but it's not available.

z^This typically happens when:
1. bitsandbytes doesn't ship with a pre-compiled binary for your zR version
2. The library wasn't compiled properly during installation from source

zlThis typically happens when you checked the code out from source and your torch installation doesn't detect z on your machine.

z(bitsandbytes tried to find a compatible z* binary but none could be loaded.
If your z_ version isn't among the available pre-compiled versions above, you must compile from source.

zPCOMPILE FROM SOURCE for CPU-only:
  `cmake -DCOMPUTE_BACKEND=cpu -S . && make`

aN  You have two options:
1. COMPILE FROM SOURCE (required if no binary exists):
   https://huggingface.co/docs/bitsandbytes/main/en/installation#cuda-compile
2. Use BNB_CUDA_VERSION to specify a DIFFERENT CUDA version from the detected one, which is installed on your machine and matching an available pre-compiled version listed above

a  You have two options:
1. COMPILE FROM SOURCE as mentioned here:
   https://huggingface.co/docs/bitsandbytes/main/en/installation?backend=AMD+ROCm#amd-gpu
2. Use BNB_ROCM_VERSION to specify a DIFFERENT ROCm version from the detected one, matching the version the library was built with.

uÀ   ðŸ”� Run this command for detailed diagnostics:
python -m bitsandbytes

If you've tried everything and still have issues:
1. Include ALL version info (operating system, bitsandbytes, pytorch, ú�, python)
2. Describe what you've tried in detail
3. Open an issue with this information:
   https://github.com/bitsandbytes-foundation/bitsandbytes/issues

r   )ÚBNB_BACKENDÚjoinr³   r8   )rJ   r¯   r°   r±   r²   ÚanalysisÚno_cpu_lib_foundÚno_cuda_lib_foundÚversion_list_strÚbase_msgÚtroubleshootingÚnoteÚcompile_instructionsÚdiagnosticss   &&&&&         r   r¶   Ú:ErrorHandlerMockBNBNativeLibrary._format_lib_error_messageÓ   s›  € ð ˆØ@ÀNÑRÐÜ*˜mÐ+<Ð=ÀÑOÐçØU‰HçßOa˜x¨(¯-©-Ð8JÓ*KÖKÐgmÐ÷ &ð œk˜]ð +!Ü!, Ð-@ÐARÐ@Sð T(Ü(3 }°LÐARÐ@Sð T8Ø8HÐ7Ið J`ñ`ð6ð ð lˆ÷ !ð	TÜT_ÐS`ð a^ñ_ð
 @ô  ALð  @Mð  Mbð  cð 	÷ !ð ;¼;¸-ð HÜ&˜-ð  (IñJð ð 	÷ %ñ c÷ #“?ñHðZð 	ð&Uô Va×UfÑUfÓUhÐTið jTðUð 	ð �˜H˜: oÐ%6°t°fÐ=QÐ<RÐSaÐRbÐbdÐepÐdqÐrÐrr   c                ó    <€ V ^8„  d   QhRS[ /# r—   r¤   )r   rD   s   "€r   r   r«   &  s   ø€ ÷ 
ñ 
©#ñ 
r   c                óî  € V P                   P                  R4      p\        V4      ^ 8”  d   V^ ,          P                  4       MRpRV P                  9   d#   V P                  P                  R4      ^ ,          MV P                  pR\
         RT R\
         RT R\
         RT R	\
         R
\
        P                  4        RT R\        '       g   RMR RV P                    R\
        P                  4        R2# )z1Format error message for missing shared librariesÚ:zunknown libraryr   r½   z" SETUP ERROR: Missing dependency: u    ðŸš¨

r   zp.x runtime libraries were not found in the LD_LIBRARY_PATH.

To fix this, make sure that:
1. You have installed z!.x toolkit on your system
2. The z· runtime libraries are in your LD_LIBRARY_PATH

You can add them with (and persist the change by adding the line to your .bashrc):
   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/Ú-z.x/Úlib64r@   z

Original error: uÂ   

ðŸ”� Run this command for detailed diagnostics:
python -m bitsandbytes

If you've tried everything and still have issues:
1. Include ALL version info (operating system, bitsandbytes, pytorch, r¾   )rª   ÚsplitÚlenÚstripr²   r¿   r8   r³   )rJ   Úerror_partsÚmissing_libÚcuda_major_versions   &   r   r´   Ú9ErrorHandlerMockBNBNativeLibrary._format_dependency_error&  s  € ð —n‘n×*Ñ*¨3Ó/ˆÜ03°KÓ0@À1Ô0D�k !•n×*Ñ*Ô,ÐJ[ˆà47¸4×;QÑ;QÔ4QˆD×"Ñ"×(Ñ(¨Ó-¨aÖ0ÐW[×WmÑWmð 	ð
 ”k�]Ð"DÀ[ÀMÐQZÜˆm˜1Ð/Ð0ð 1%ä%0 M°Ð3EÐ2Fð GÜ!�]ð #CäCN×CTÑCTÓCVÐBWÐWXÐYkÐXlÐloß-›o‰w°5Ð9ð :Ø#Ÿ~™~Ð.ð /Uô Va×UfÑUfÓUhÐTið jTðUð	
r   c                ó   a a€ VV 3R lpV# )zPReturn a dummy function that throws when called, rather than on attribute accessc                  ó:   <€ \        SP                   R S R24      h)z*Native code method attempted to call: lib.z())r(   rµ   )rO   rP   rQ   rJ   s   *,€€r   rR   ÚCErrorHandlerMockBNBNativeLibrary.__getattr__.<locals>.throw_on_callE  s&   ø€ Ü $×"6Ñ"6Ð!7Ð7aÐbfÐagÐgiÐjÓkÐkr   rw   )rJ   rQ   rR   s   ff r   rV   Ú,ErrorHandlerMockBNBNativeLibrary.__getattr__B  s   ù€ ö	lð Ðr   c                ó$   € V P                  V4      # rG   rY   )rJ   rQ   s   &&r   r[   Ú,ErrorHandlerMockBNBNativeLibrary.__getitem__J  r]   r   )r¯   rª   rµ   r²   )r®   N)r_   r`   ra   rb   r�   rK   r¶   r´   rV   r[   rg   rh   ri   s   @r   r¨   r¨   «   s<   ø‡ € ñ÷(ð ÷&Qsò Qs÷f
ð 
ò8÷&ð &r   r¨   c                ó$   € V ^8„  d   QhR\         /# r—   r   )r   s   "r   r   r   N  s   € ÷ Hñ H¤$ñ Hr   c                 óÚ   € \        \        P                  RR4      p V '       d6   \        RV R,           \         2,          pVP                  4       '       d   V# \        R\         2,          # )zêGet the path to the XPU native library matching the oneAPI toolchain.

Prefers the versioned library (e.g. libbitsandbytes_xpu2026) matching the first
4 digits of torch.version.xpu, falling back to an unversioned libbitsandbytes_xpu.
ÚxpuNÚlibbitsandbytes_xpu:Né   N)rT   r!   r"   r   r   Úexists)Úxpu_versionÚ	versioneds     r   Úget_xpu_bnb_library_pathrå   N  s`   € ô œ%Ÿ-™-¨°Ó5€KßÜÐ$7¸ÀB½Ð7HÔI_ÐH`Ð"aÕaˆ	Ø×Ñ×ÒØÐÜÐ.Ô/EÐ.FÐGÕGÐGr   c                ó$   € V ^8„  d   QhR\         /# r—   )r=   )r   s   "r   r   r   \  s   € ÷ !ñ !Ô,ñ !r   c                 ó8  € \        4       p \        R\         2,          pV '       d9   \        V 4      pVP	                  4       '       g   \        R\         RV 24      hTp\        P                  P                  '       d   \        4       p\        P                  RV 24       \        P                  P                  \!        V4      4      p\#        VR4      '       d   \%        V4      # \        P                  P                  '       d   \'        V4      # \)        V4      # )zV
Load CUDA library XOR CPU, as the latter contains a subset of symbols of the former.
Úlibbitsandbytes_cpuzNo compatible z binary found at z*Loading bitsandbytes native library from: rq   )r	   r   r   r;   râ   r(   r¿   r!   Ú_CÚ_has_xpurå   r)   ÚdebugrB   ÚcdllÚLoadLibraryr„   r   rk   r{   r=   )r   Úbinary_pathÚcuda_binary_pathÚdlls       r   Úget_native_libraryrñ   \  sâ   € ô  Ó!€JÜÐ"5Ô6LÐ5MÐ NÕN€KçÜ4°ZÓ@Ðà×&Ñ&×(Ò(Ü ´¨}Ð<MÐN^ÐM_Ð`ÓaÐaà&ˆä‡x�x××ÐÜ.Ó0ˆä
‡L�LÐ=¸k¸]ÐKÔLô �'‰'×
Ñ
œc +Ó.Ó
/€Cäˆs�M×"Ò"Ü# CÓ(Ð(ä‡x�x××ÐÜ" 3Ó'Ð'ä˜CÓ Ð r   FÚCPUTr   r   ÚXPUz'XPU/CPU can run without native library.z!bitsandbytes library load error: )Úexc_info)rò   ró   )0ÚctypesrB   rd   Úloggingr$   Úpathlibr   r�   Útypingr   r!   Úbitsandbytes.constsr   r   Úbitsandbytes.cuda_specsr   r	   r
   r   Ú	getLoggerr_   r)   r;   r=   rk   r{   r‰   r+   r¡   r¦   r¨   rå   rñ   ÚROCM_GPU_ARCHr³   r¿   r"   r#   r   Úis_availableré   rê   r@   Ú	ExceptionÚer„   rª   Úerrorrw   r   r   Ú<module>r     sU  ðÛ Û Û Û 	Ý Û 	Ý ã ç C÷ó ð 
×	Ò	˜8Ó	$€õ:÷z&ñ &ô43Ð+ô 3ô7Ð*ô 7õ	.õ
õZõ	ô`&Ð'7ô `&õFHõ!ñ@ "Ó#€à€Ø€Ø‡=�=××ÐØ€OØ�KØ
‡Z�Z×Ñ×ÒØ�KØ
‡X�X××ÐØ€Kð:Ù
Ó
‚CøØô :Ø�nÔ$Ù.Ð/XÓYŽá˜“Fˆ	Ø�‰Ø/°	¨{Ð;Øð 	ô 	
ñ /¨yÓ9Žûð:ús   ÄD ÄE$ÄEÄ3&EÅE$