[Build][CI] Drop Python 3.10: require Python 3.11+ and run CUDA CI on Python 3.12 (#43021)

Co-authored-by: Mohammad Angkad <mohammad.angkad@radixark.ai>
Co-authored-by: Mohammad Miadh Angkad <176301910+mmangkad@users.noreply.github.com>
This commit is contained in:
Xinyuan Tong
2026-10-12 18:40:16 -07:00
committed by GitHub
co-authored by Mohammad Angkad Mohammad Miadh Angkad
parent 59445b3da1
commit e775fa7253
39 changed files with 159 additions and 105 deletions
+1 -2
View File
@@ -13,7 +13,7 @@ name = "sglang"
dynamic = ["version"]
description = "SGLang is a fast serving framework for large language models and vision language models."
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
license = { file = "LICENSE" }
classifiers = [
"Programming Language :: Python :: 3",
@@ -86,7 +86,6 @@ dependencies = [
"timm==1.0.16",
"tokenizers==0.23.2",
"tokenspeed_mla==0.1.8",
"tomli ; python_version < '3.11'",
"torch==2.14.1",
"torch_memory_saver>=0.0.9.post1",
"torchaudio==2.11.0",
+1 -1
View File
@@ -8,7 +8,7 @@ name = "sglang-cpu"
dynamic = ["version"]
description = "SGLang is a fast serving framework for large language models and vision language models."
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
license = { file = "LICENSE" }
classifiers = [
"Programming Language :: Python :: 3",
+1 -1
View File
@@ -7,7 +7,7 @@ name = "sglang"
dynamic = ["version"]
description = "SGLang is a fast serving framework for large language models and vision language models."
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
license = { file = "LICENSE" }
classifiers = [
"Programming Language :: Python :: 3",
+1 -1
View File
@@ -7,7 +7,7 @@ name = "sglang"
dynamic = ["version"]
description = "SGLang is a fast serving framework for large language models and vision language models."
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.11"
license = { file = "LICENSE" }
classifiers = [
"Programming Language :: Python :: 3",
@@ -46,6 +46,7 @@ from sglang.multimodal_gen.runtime.utils.logging_utils import (
globally_suppress_loggers,
init_logger,
)
from sglang.srt.observability.trace import fastapi_telemetry_disabled_kwargs
from sglang.srt.utils.common import (
add_prometheus_middleware,
add_prometheus_track_response_middleware,
@@ -430,7 +431,7 @@ def create_app(server_args: ServerArgs):
Create and configure the FastAPI application instance.
"""
globally_suppress_loggers()
app = FastAPI(lifespan=lifespan)
app = FastAPI(lifespan=lifespan, **fastapi_telemetry_disabled_kwargs())
if server_args.enable_metrics:
configure_metrics()
add_prometheus_middleware(app)
@@ -104,10 +104,7 @@ class TestDecodeHandsOutFinishedFrames(CustomTestCase):
)
@unittest.skipUnless(
torch.cuda.is_available() and hasattr(os, "memfd_create"),
"needs CUDA and memfd",
)
@unittest.skipUnless(condition=torch.cuda.is_available(), reason="needs CUDA")
class TestStreamedEncode(CustomTestCase):
@staticmethod
def _video(height: int, width: int) -> torch.Tensor:
@@ -5,7 +5,6 @@ The frame hand-off itself is covered in
python/sglang/multimodal_gen/test/unit/test_wan_vae_on_frames.py.
"""
import os
import tempfile
import unittest
from pathlib import Path
@@ -103,10 +102,7 @@ def _video_request(**overrides) -> SimpleNamespace:
return SimpleNamespace(**fields)
@unittest.skipUnless(
torch.cuda.is_available() and hasattr(os, "memfd_create"),
"needs CUDA and memfd",
)
@unittest.skipUnless(condition=torch.cuda.is_available(), reason="needs CUDA")
class TestStreamedEncode(CustomTestCase):
@torch.no_grad()
def test_hunyuan_without_callback_matches_one_shot_mp4(self):
@@ -47,6 +47,7 @@ from sglang.srt.managers.io_struct import (
wrap_as_pickle,
)
from sglang.srt.managers.schedule_batch import Modality
from sglang.srt.observability.trace import fastapi_telemetry_disabled_kwargs
from sglang.srt.runtime_context import (
get_disagg,
get_observability,
@@ -100,7 +101,7 @@ async def _lifespan(app: FastAPI):
await local_runtime.stop()
app = FastAPI(lifespan=_lifespan)
app = FastAPI(lifespan=_lifespan, **fastapi_telemetry_disabled_kwargs())
def _register_encoder_url_with_bootstrap():
@@ -36,6 +36,7 @@ from sglang.srt.managers.multimodal_processor import get_mm_processor, import_pr
from sglang.srt.managers.schedule_batch import Modality, Req
from sglang.srt.multimodal.cache import media_preprocess_kwargs
from sglang.srt.multimodal.transport import determine_tensor_transport_mode
from sglang.srt.observability.trace import fastapi_telemetry_disabled_kwargs
from sglang.srt.runtime_context import (
get_device,
get_disagg,
@@ -164,7 +165,9 @@ class EncoderBootstrapServer:
except (asyncio.CancelledError, Exception):
pass
self.app = FastAPI(lifespan=lifespan, openapi_url=None)
self.app = FastAPI(
lifespan=lifespan, openapi_url=None, **fastapi_telemetry_disabled_kwargs()
)
@self.app.get("/health")
async def _health() -> Response:
@@ -10,6 +10,7 @@ from fastapi import FastAPI
from fastapi.responses import PlainTextResponse
from sglang.srt.distributed.parallel_state import get_world_group
from sglang.srt.observability.trace import fastapi_telemetry_disabled_kwargs
logger = logging.getLogger(__name__)
@@ -82,7 +83,7 @@ class _GatedLaunchServer:
def _build_app(server: _GatedLaunchServer) -> FastAPI:
app = FastAPI()
app = FastAPI(**fastapi_telemetry_disabled_kwargs())
@app.get("/health")
def health():
@@ -20,6 +20,8 @@ import uvicorn
from fastapi import FastAPI, HTTPException
from fastapi.responses import PlainTextResponse
from sglang.srt.observability.trace import fastapi_telemetry_disabled_kwargs
logger = logging.getLogger(__name__)
@@ -42,7 +44,7 @@ class EngineInfoBootstrapServer:
self.transfer_engine_info: Dict[int, Tuple] = {}
self.lock = threading.Lock()
app = FastAPI()
app = FastAPI(**fastapi_telemetry_disabled_kwargs())
@app.get("/health")
def health():
@@ -169,6 +169,7 @@ from sglang.srt.managers.multi_tokenizer_mixin import (
from sglang.srt.managers.tokenizer_manager import ServerStatus, TokenizerManager
from sglang.srt.observability.func_timer import enable_func_timer
from sglang.srt.observability.trace import (
fastapi_telemetry_disabled_kwargs,
process_tracing_init,
set_global_trace_level,
trace_set_thread_info,
@@ -479,6 +480,7 @@ class ORJSONRoute(APIRoute):
app = FastAPI(
lifespan=lifespan,
openapi_url=None if get_bool_env_var("DISABLE_OPENAPI_DOC") else "/openapi.json",
**fastapi_telemetry_disabled_kwargs(),
)
app.router.route_class = ORJSONRoute
app.add_middleware(
+5
View File
@@ -269,6 +269,11 @@ def get_global_tracing_enabled():
return opentelemetry_initialized
def fastapi_telemetry_disabled_kwargs() -> Dict[str, Any]:
# FastAPI traces every request under process_tracing_init's provider by default.
return {"telemetry": {"tracing": False, "metrics": False, "logs": False}}
def get_otlp_span_exporter(endpoint):
protocol = os.environ.get(OTEL_EXPORTER_OTLP_TRACES_PROTOCOL, "grpc")
supported_protocols = {"grpc", "http/protobuf"}
+2 -1
View File
@@ -3678,9 +3678,10 @@ def launch_dummy_health_check_server(host, port, enable_metrics):
import uvicorn
from fastapi import FastAPI, Response
from sglang.srt.observability.trace import fastapi_telemetry_disabled_kwargs
from sglang.srt.utils.network import NetworkAddress
app = FastAPI()
app = FastAPI(**fastapi_telemetry_disabled_kwargs())
@app.get("/ping")
async def ping():