@@ -512,54 +512,6 @@ def get_aphrodite_version() -> str:
512512 return version
513513
514514
515- def get_kernels_extra_index_url () -> str | None :
516- """Get the extra index URL for aphrodite-kernels wheels based on target device."""
517- base_url = "https://downloads.pygmalion.chat/whl"
518-
519- if _is_cpu ():
520- return f"{ base_url } /cpu"
521- elif _is_hip ():
522- return f"{ base_url } /rocm"
523- elif _is_cuda ():
524- # Determine CUDA version for wheel URL
525- cuda_version = None
526- if torch .version .cuda :
527- cuda_major , cuda_minor = torch .version .cuda .split ("." )
528- cuda_version_str = f"{ cuda_major } { cuda_minor } "
529- # Support CUDA 12.6, 12.8, and 12.9
530- if cuda_version_str in ["126" , "128" , "129" ]:
531- cuda_version = cuda_version_str
532- else :
533- # Fallback to detected version or default
534- try :
535- nvcc_version = get_nvcc_cuda_version ()
536- if nvcc_version >= Version ("12.9" ):
537- cuda_version = "129"
538- elif nvcc_version >= Version ("12.8" ):
539- cuda_version = "128"
540- elif nvcc_version >= Version ("12.6" ):
541- cuda_version = "126"
542- except Exception :
543- pass
544-
545- # Use MAIN_CUDA_VERSION as fallback
546- if cuda_version is None :
547- main_cuda = envs .APHRODITE_MAIN_CUDA_VERSION
548- if main_cuda == "12.9" :
549- cuda_version = "129"
550- elif main_cuda == "12.8" :
551- cuda_version = "128"
552- elif main_cuda == "12.6" :
553- cuda_version = "126"
554- else :
555- # Default to 12.8
556- cuda_version = "128"
557-
558- return f"{ base_url } /cu{ cuda_version } "
559-
560- return None
561-
562-
563515def get_requirements () -> list [str ]:
564516 """Get Python package dependencies from requirements.txt."""
565517 requirements_dir = ROOT_DIR / "requirements"
@@ -589,48 +541,6 @@ def _read_requirements(filename: str) -> list[str]:
589541 modified_requirements .append (req )
590542 requirements = modified_requirements
591543
592- # Add CUDA-specific kernels requirements file based on detected CUDA version
593- cuda_version = None
594- if torch .version .cuda :
595- cuda_major , cuda_minor = torch .version .cuda .split ("." )
596- cuda_version_str = f"{ cuda_major } { cuda_minor } "
597- if cuda_version_str == "128" :
598- cuda_version = "128"
599- elif cuda_version_str == "129" :
600- cuda_version = "129"
601- else :
602- # Try to detect from nvcc
603- try :
604- nvcc_version = get_nvcc_cuda_version ()
605- if nvcc_version >= Version ("12.9" ):
606- cuda_version = "129"
607- elif nvcc_version >= Version ("12.8" ):
608- cuda_version = "128"
609- except Exception :
610- pass
611-
612- # Use MAIN_CUDA_VERSION as fallback
613- if cuda_version is None :
614- main_cuda = envs .APHRODITE_MAIN_CUDA_VERSION
615- if main_cuda == "12.9" :
616- cuda_version = "129"
617- elif main_cuda == "12.8" :
618- cuda_version = "128"
619-
620- # Add kernels requirements file if CUDA version is supported
621- if cuda_version == "128" :
622- requirements += _read_requirements ("cu128.txt" )
623- elif cuda_version == "129" :
624- requirements += _read_requirements ("cu129.txt" )
625- else :
626- # If cuda_version is None or unsupported, don't add kernels
627- # User will need to build from source
628- logger .warning (
629- "No pre-built aphrodite-kernels wheels available for CUDA version %s. "
630- "Only CUDA 12.8 and 12.9 are supported. "
631- "You will need to build aphrodite-kernels from source." ,
632- torch .version .cuda if torch .version .cuda else "unknown" ,
633- )
634544 elif _is_hip ():
635545 requirements = _read_requirements ("rocm.txt" )
636546 elif _is_hpu ():
@@ -644,27 +554,15 @@ def _read_requirements(filename: str) -> list[str]:
644554 else :
645555 raise ValueError ("Unsupported platform, please use CUDA, ROCm, or CPU." )
646556
557+ # Filter out aphrodite-kernels from install_requires
558+ # Users will get a helpful error message when they try to import it
559+ requirements = [req for req in requirements if "aphrodite-kernels" not in req .lower ()]
560+
647561 return requirements
648562
649563
650564ext_modules = []
651565
652- # Determine extra index URL for aphrodite-kernels wheels
653- kernels_extra_index_url = get_kernels_extra_index_url ()
654- if kernels_extra_index_url :
655- current_extra_index = os .environ .get ("PIP_EXTRA_INDEX_URL" , "" )
656- if kernels_extra_index_url not in current_extra_index :
657- if current_extra_index :
658- os .environ ["PIP_EXTRA_INDEX_URL" ] = f"{ current_extra_index } { kernels_extra_index_url } "
659- else :
660- os .environ ["PIP_EXTRA_INDEX_URL" ] = kernels_extra_index_url
661- logger .info (
662- "Added extra index URL for aphrodite-kernels: %s\n "
663- "To install with this index URL, use: pip install --extra-index-url %s ." ,
664- kernels_extra_index_url ,
665- kernels_extra_index_url ,
666- )
667-
668566package_data = {
669567 "aphrodite" : [
670568 "endpoints/kobold/klite.embd" ,
0 commit comments