From 6a3bd014f3ec10439f84130dc59db20c6d6d08ad Mon Sep 17 00:00:00 2001 From: dylan Date: Wed, 15 Jul 2026 23:25:30 +0000 Subject: [PATCH 1/3] clamp CLIP verification batch sizes per modality --- gas/verification/verification_pipeline.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/gas/verification/verification_pipeline.py b/gas/verification/verification_pipeline.py index bb705435..54d81082 100644 --- a/gas/verification/verification_pipeline.py +++ b/gas/verification/verification_pipeline.py @@ -164,12 +164,17 @@ def verify_media( ) all_results = [] - + + # Videos decode multiple frames each, so they need a much lower + # per-batch cap than images even at the same batch_size. + image_batch_size = min(batch_size, 128) + video_batch_size = min(batch_size, 32) + image_features = None if image_entries: - bt.logging.info(f"Processing {len(image_entries)} images (batch_size={batch_size})") + bt.logging.info(f"Processing {len(image_entries)} images (batch_size={image_batch_size})") result = calculate_clip_alignment_consensus( - image_paths, image_prompts, batch_size=batch_size, return_features=True + image_paths, image_prompts, batch_size=image_batch_size, return_features=True ) if result is not None: image_consensus, image_features = result @@ -177,9 +182,9 @@ def verify_media( video_features = None if video_entries: - bt.logging.info(f"Processing {len(video_entries)} videos (batch_size={batch_size})") + bt.logging.info(f"Processing {len(video_entries)} videos (batch_size={video_batch_size})") result = calculate_clip_alignment_consensus( - video_paths, video_prompts, batch_size=batch_size, return_features=True + video_paths, video_prompts, batch_size=video_batch_size, return_features=True ) if result is not None: video_consensus, video_features = result From 4a4c2c5ee8b2282509f4bb092f23e14a66f3d431 Mon Sep 17 00:00:00 2001 From: dylan Date: Wed, 15 Jul 2026 23:27:43 +0000 Subject: [PATCH 2/3] bump version --- VERSION | 2 +- gas/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 6ed7776b..5b341fd7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.9.0 +4.9.1 diff --git a/gas/__init__.py b/gas/__init__.py index 0996c533..ab3915de 100644 --- a/gas/__init__.py +++ b/gas/__init__.py @@ -1,4 +1,4 @@ -__version__ = "4.9.0" +__version__ = "4.9.1" version_split = __version__.split(".") __spec_version__ = ( From 902b792768e6c51c16f9e8192c02bf3ec760f7f6 Mon Sep 17 00:00:00 2001 From: dylan Date: Wed, 15 Jul 2026 23:37:07 +0000 Subject: [PATCH 3/3] make CLIP verification batch size params explicit per modality --- gas/verification/verification_pipeline.py | 25 +++++++++++-------- .../validator/services/generator_service.py | 1 - 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/gas/verification/verification_pipeline.py b/gas/verification/verification_pipeline.py index 54d81082..c2618676 100644 --- a/gas/verification/verification_pipeline.py +++ b/gas/verification/verification_pipeline.py @@ -21,7 +21,8 @@ def run_verification( content_manager: ContentManager, batch_size: Optional[int] = 10, threshold: float = 0.25, - clip_batch_size: int = 32, + image_batch_size: int = 128, + video_batch_size: int = 32, ) -> List[VerificationResult]: """ Run CLIP verification on unverified miner media. @@ -30,10 +31,14 @@ def run_verification( content_manager: ContentManager instance batch_size: Number of media entries to process from database (None = process all) threshold: Verification threshold - clip_batch_size: Batch size for CLIP operations (adjust based on GPU memory) + image_batch_size: Images per CLIP forward pass (they're stacked into + one tensor, so this bounds peak VRAM directly) + video_batch_size: Videos per CLIP batch (each decodes multiple + frames, so this must be much lower than image_batch_size) """ bt.logging.info( - f"Starting verification batch (batch_size={batch_size}, clip_batch_size={clip_batch_size})" + f"Starting verification batch (batch_size={batch_size}, " + f"image_batch_size={image_batch_size}, video_batch_size={video_batch_size})" ) pending_media = content_manager.get_miner_media(verification_status="pending") @@ -56,7 +61,8 @@ def run_verification( content_manager=content_manager, media_entries=batch, threshold=threshold, - batch_size=clip_batch_size, + image_batch_size=image_batch_size, + video_batch_size=video_batch_size, ) bt.logging.info("Verification batch complete, updating database") @@ -93,7 +99,8 @@ def verify_media( content_manager: ContentManager, media_entries: List[MediaEntry], threshold: float = 0.25, - batch_size: int = 32, + image_batch_size: int = 128, + video_batch_size: int = 32, ) -> List[VerificationResult]: """ Verify a batch of miner media entries using CLIP consensus scoring. @@ -102,7 +109,8 @@ def verify_media( content_manager: ContentManager instance media_entries: List of MediaEntry objects to verify threshold: Verification threshold - batch_size: Batch size for CLIP operations + image_batch_size: Images per CLIP forward pass + video_batch_size: Videos per CLIP batch Returns: List of VerificationResult objects @@ -165,11 +173,6 @@ def verify_media( all_results = [] - # Videos decode multiple frames each, so they need a much lower - # per-batch cap than images even at the same batch_size. - image_batch_size = min(batch_size, 128) - video_batch_size = min(batch_size, 32) - image_features = None if image_entries: bt.logging.info(f"Processing {len(image_entries)} images (batch_size={image_batch_size})") diff --git a/neurons/validator/services/generator_service.py b/neurons/validator/services/generator_service.py index 281b0c09..5933437e 100644 --- a/neurons/validator/services/generator_service.py +++ b/neurons/validator/services/generator_service.py @@ -798,7 +798,6 @@ def _run_verification(self): content_manager=self.content_manager, batch_size=self._verification_max_batch, threshold=0.25, - clip_batch_size=512, ) if results: