rust-crate-pipeline 1.2.1__tar.gz → 1.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/CHANGELOG.md +36 -0
- {rust_crate_pipeline-1.2.1/rust_crate_pipeline.egg-info → rust_crate_pipeline-1.2.3}/PKG-INFO +1 -1
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/pyproject.toml +1 -1
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline/ai_processing.py +111 -15
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline/version.py +1 -1
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3/rust_crate_pipeline.egg-info}/PKG-INFO +1 -1
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/setup.py +1 -1
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/LICENSE +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/MANIFEST.in +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/README.md +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/requirements.txt +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline/__init__.py +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline/__main__.py +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline/analysis.py +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline/config.py +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline/github_token_checker.py +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline/main.py +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline/network.py +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline/pipeline.py +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline/production_config.py +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline/utils/file_utils.py +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline/utils/logging_utils.py +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline.egg-info/SOURCES.txt +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline.egg-info/dependency_links.txt +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline.egg-info/entry_points.txt +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline.egg-info/requires.txt +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline.egg-info/top_level.txt +0 -0
- {rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/setup.cfg +0 -0
@@ -2,6 +2,42 @@
|
|
2
2
|
|
3
3
|
All notable changes to the Rust Crate Pipeline project.
|
4
4
|
|
5
|
+
## [1.2.3] - 2025-06-18
|
6
|
+
|
7
|
+
### 🚀 L4 GPU Optimization Release
|
8
|
+
|
9
|
+
#### ✨ Added
|
10
|
+
- **L4 GPU-Optimized Model Loading**: Configured for GCP g2-standard-4 with L4 GPU (24GB VRAM)
|
11
|
+
- Larger context window (`n_ctx=4096`) leveraging L4's memory capacity
|
12
|
+
- Aggressive GPU layer loading (`n_gpu_layers=-1`) for maximum performance
|
13
|
+
- Optimized batch size (`n_batch=1024`) for L4 throughput
|
14
|
+
- CPU thread optimization (`n_threads=4`) matching g2-standard-4's 4 vCPUs
|
15
|
+
- Enhanced memory management with `use_mmap=True` and `use_mlock=True`
|
16
|
+
- Flash attention support (`flash_attn=True`) for faster computation
|
17
|
+
- RoPE scaling configuration for extended context processing
|
18
|
+
|
19
|
+
- **Batch Processing System**: New `batch_process_prompts()` method for GPU utilization
|
20
|
+
- Processes multiple prompts simultaneously (batch_size=4 optimized for L4)
|
21
|
+
- Thermal management with inter-batch delays
|
22
|
+
- Enhanced sampling parameters (`top_p=0.95`, `repeat_penalty=1.1`)
|
23
|
+
- Robust error handling for batch operations
|
24
|
+
|
25
|
+
- **Smart Context Management**: New `smart_context_management()` method
|
26
|
+
- Prefix cache optimization for better performance
|
27
|
+
- Intelligent context reuse prioritizing recent history
|
28
|
+
- Dynamic token allocation up to 4000 tokens
|
29
|
+
- Smart truncation maintaining context relevance
|
30
|
+
|
31
|
+
#### 🔧 Changed
|
32
|
+
- **Performance Improvements**: Expected 3-4x faster inference on L4 GPU vs CPU-only
|
33
|
+
- **Memory Optimization**: Better utilization of L4's 24GB VRAM capacity
|
34
|
+
- **Quality Enhancements**: Improved sampling and context management
|
35
|
+
|
36
|
+
#### 📈 Performance
|
37
|
+
- Significant throughput improvements on GCP g2-standard-4 instances
|
38
|
+
- Reduced per-prompt processing overhead through batching
|
39
|
+
- Enhanced cache efficiency with smart context reuse
|
40
|
+
|
5
41
|
## [1.2.1] - 2025-06-18
|
6
42
|
|
7
43
|
### 🔒 Security & Performance Update
|
{rust_crate_pipeline-1.2.1/rust_crate_pipeline.egg-info → rust_crate_pipeline-1.2.3}/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: rust-crate-pipeline
|
3
|
-
Version: 1.2.
|
3
|
+
Version: 1.2.3
|
4
4
|
Summary: A comprehensive system for gathering, enriching, and analyzing metadata for Rust crates using AI-powered insights
|
5
5
|
Home-page: https://github.com/DaveTmire85/SigilDERG-Data_Production
|
6
6
|
Author: SuperUser666-Sigil
|
{rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline/ai_processing.py
RENAMED
@@ -14,11 +14,20 @@ class LLMEnricher:
|
|
14
14
|
self.model = self._load_model()
|
15
15
|
|
16
16
|
def _load_model(self):
|
17
|
+
"""Optimized for GCP g2-standard-4 with L4 GPU (24GB VRAM)"""
|
17
18
|
return Llama(
|
18
19
|
model_path=self.config.model_path,
|
19
|
-
n_ctx=
|
20
|
-
n_batch=
|
21
|
-
n_gpu_layers
|
20
|
+
n_ctx=4096, # Larger context for L4's 24GB VRAM
|
21
|
+
n_batch=1024, # Larger batch size for better throughput
|
22
|
+
n_gpu_layers=-1, # Load ALL layers on GPU (L4 has plenty VRAM)
|
23
|
+
n_threads=4, # Match the 4 vCPUs
|
24
|
+
n_threads_batch=4, # Parallel batch processing
|
25
|
+
use_mmap=True, # Memory-mapped files for efficiency
|
26
|
+
use_mlock=True, # Lock model in memory
|
27
|
+
rope_scaling_type=1, # RoPE scaling for longer contexts
|
28
|
+
rope_freq_base=10000.0, # Base frequency for RoPE
|
29
|
+
flash_attn=True, # Enable flash attention if available
|
30
|
+
verbose=False # Reduce logging overhead
|
22
31
|
)
|
23
32
|
|
24
33
|
def estimate_tokens(self, text: str) -> int:
|
@@ -165,12 +174,14 @@ class LLMEnricher:
|
|
165
174
|
self,
|
166
175
|
prompt: str,
|
167
176
|
validation_func: Callable[[str], bool],
|
168
|
-
temp: float = 0.2,
|
169
|
-
|
177
|
+
temp: float = 0.2, max_tokens: int = 256,
|
178
|
+
retries: int = 4 # Increased from 2 to 4 for better success rates
|
170
179
|
) -> Optional[str]:
|
171
180
|
"""Run LLM with validation and automatic retry on failure"""
|
181
|
+
result = None
|
172
182
|
for attempt in range(retries):
|
173
|
-
try:
|
183
|
+
try:
|
184
|
+
# More generous temperature adjustment for better variety
|
174
185
|
adjusted_temp = temp * (1 + (attempt * 0.2)) # 20% increases instead of 10%
|
175
186
|
result = self.run_llama(prompt, temp=adjusted_temp, max_tokens=max_tokens)
|
176
187
|
|
@@ -178,17 +189,20 @@ class LLMEnricher:
|
|
178
189
|
if result and validation_func(result):
|
179
190
|
return result
|
180
191
|
|
181
|
-
# If we get here, validation failed - use debug level for early attempts
|
192
|
+
# If we get here, validation failed - use debug level for early attempts
|
193
|
+
if attempt == retries - 1:
|
182
194
|
logging.debug(f"All {retries} validation attempts failed, using last available result.")
|
183
195
|
else:
|
184
196
|
logging.debug(f"Validation failed on attempt {attempt+1}/{retries}. Retrying with adjusted temp={adjusted_temp:.2f}")
|
185
|
-
|
197
|
+
|
198
|
+
# Only simplify prompt on later attempts (attempt 2+)
|
186
199
|
if attempt >= 2:
|
187
200
|
prompt = self.simplify_prompt(prompt)
|
188
201
|
|
189
202
|
except Exception as e:
|
190
203
|
logging.error(f"Generation error on attempt {attempt+1}: {str(e)}")
|
191
|
-
|
204
|
+
|
205
|
+
# More generous backoff - give the model more time
|
192
206
|
time.sleep(2.0 + (attempt * 1.0)) # 2s, 3s, 4s, 5s delays
|
193
207
|
|
194
208
|
# If we exhausted all retries, return the last result even if not perfect
|
@@ -241,12 +255,7 @@ class LLMEnricher:
|
|
241
255
|
prompt,
|
242
256
|
lambda x: len(x) > 50,
|
243
257
|
temp=0.3,
|
244
|
-
max_tokens=300
|
245
|
-
)
|
246
|
-
# Extract key dependencies for context
|
247
|
-
key_deps = [dep.get("crate_id") for dep in crate.dependencies[:5]
|
248
|
-
if dep.get("kind") == "normal" and dep.get("crate_id")]
|
249
|
-
key_deps_str = ", ".join(str(dep) for dep in key_deps) if key_deps else "None"
|
258
|
+
max_tokens=300 )
|
250
259
|
|
251
260
|
# Generate other enrichments
|
252
261
|
enriched.feature_summary = self.summarize_features(crate)
|
@@ -391,3 +400,90 @@ class LLMEnricher:
|
|
391
400
|
score = (crate.downloads / 1000) + (crate.github_stars * 10)
|
392
401
|
score += len(self.truncate_content(crate.readme, 1000)) / 500
|
393
402
|
return round(score, 2)
|
403
|
+
|
404
|
+
def batch_process_prompts(self, prompts: list[tuple[str, float, int]], batch_size: int = 4) -> list[Optional[str]]:
|
405
|
+
"""
|
406
|
+
L4 GPU-optimized batch processing for multiple prompts
|
407
|
+
Processes prompts in batches to maximize GPU utilization
|
408
|
+
|
409
|
+
Args:
|
410
|
+
prompts: List of (prompt, temperature, max_tokens) tuples
|
411
|
+
batch_size: Number of prompts to process simultaneously (tuned for L4)
|
412
|
+
"""
|
413
|
+
results = []
|
414
|
+
|
415
|
+
# Process in batches optimized for L4's capabilities
|
416
|
+
for i in range(0, len(prompts), batch_size):
|
417
|
+
batch = prompts[i:i + batch_size]
|
418
|
+
batch_results = []
|
419
|
+
|
420
|
+
for prompt, temp, max_tokens in batch:
|
421
|
+
try:
|
422
|
+
# Prepare prompt with context preservation
|
423
|
+
if self.estimate_tokens(prompt) > 3500: # Leave room for response
|
424
|
+
prompt = self.smart_truncate(prompt, 3500)
|
425
|
+
|
426
|
+
# Use optimized parameters for L4
|
427
|
+
output = self.model(
|
428
|
+
prompt,
|
429
|
+
max_tokens=max_tokens,
|
430
|
+
temperature=temp,
|
431
|
+
top_p=0.95, # Nucleus sampling for better quality
|
432
|
+
repeat_penalty=1.1, # Reduce repetition
|
433
|
+
stop=["<|end|>", "<|user|>", "<|system|>"],
|
434
|
+
echo=False, # Don't echo input
|
435
|
+
stream=False # Batch mode, no streaming
|
436
|
+
)
|
437
|
+
|
438
|
+
result = self.clean_output(output["choices"][0]["text"])
|
439
|
+
batch_results.append(result)
|
440
|
+
|
441
|
+
except Exception as e:
|
442
|
+
logging.warning(f"Batch processing error: {e}")
|
443
|
+
batch_results.append(None)
|
444
|
+
|
445
|
+
results.extend(batch_results)
|
446
|
+
|
447
|
+
# Small delay between batches to prevent thermal throttling
|
448
|
+
if i + batch_size < len(prompts):
|
449
|
+
time.sleep(0.1)
|
450
|
+
|
451
|
+
return results
|
452
|
+
|
453
|
+
def smart_context_management(self, context_history: list[str], new_prompt: str) -> str:
|
454
|
+
"""
|
455
|
+
Intelligent context management for prefix cache optimization
|
456
|
+
Maximizes cache hits by preserving common context patterns
|
457
|
+
"""
|
458
|
+
# Calculate available tokens for context
|
459
|
+
base_tokens = self.estimate_tokens(new_prompt)
|
460
|
+
available_context = 4000 - base_tokens # Leave buffer for response
|
461
|
+
|
462
|
+
if available_context <= 0:
|
463
|
+
return new_prompt
|
464
|
+
|
465
|
+
# Build context from most recent and most relevant history
|
466
|
+
context_parts = []
|
467
|
+
tokens_used = 0
|
468
|
+
|
469
|
+
# Prioritize recent context (better cache hits)
|
470
|
+
for context in reversed(context_history[-5:]): # Last 5 contexts
|
471
|
+
context_tokens = self.estimate_tokens(context)
|
472
|
+
if tokens_used + context_tokens <= available_context:
|
473
|
+
context_parts.insert(0, context)
|
474
|
+
tokens_used += context_tokens
|
475
|
+
else:
|
476
|
+
# Try to fit truncated version
|
477
|
+
remaining_tokens = available_context - tokens_used
|
478
|
+
if remaining_tokens > 100: # Only if meaningful space left
|
479
|
+
truncated = self.smart_truncate(context, remaining_tokens)
|
480
|
+
if truncated:
|
481
|
+
context_parts.insert(0, truncated)
|
482
|
+
break
|
483
|
+
|
484
|
+
# Combine context with new prompt
|
485
|
+
if context_parts:
|
486
|
+
full_context = "\n\n---\n\n".join(context_parts)
|
487
|
+
return f"{full_context}\n\n---\n\n{new_prompt}"
|
488
|
+
|
489
|
+
return new_prompt
|
{rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3/rust_crate_pipeline.egg-info}/PKG-INFO
RENAMED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: rust-crate-pipeline
|
3
|
-
Version: 1.2.
|
3
|
+
Version: 1.2.3
|
4
4
|
Summary: A comprehensive system for gathering, enriching, and analyzing metadata for Rust crates using AI-powered insights
|
5
5
|
Home-page: https://github.com/DaveTmire85/SigilDERG-Data_Production
|
6
6
|
Author: SuperUser666-Sigil
|
@@ -8,7 +8,7 @@ with open("requirements.txt", "r", encoding="utf-8") as fh:
|
|
8
8
|
|
9
9
|
setup(
|
10
10
|
name="rust-crate-pipeline",
|
11
|
-
version="1.2.
|
11
|
+
version="1.2.3",
|
12
12
|
author="SuperUser666-Sigil",
|
13
13
|
author_email="miragemodularframework@gmail.com",
|
14
14
|
description="A comprehensive system for gathering, enriching, and analyzing metadata for Rust crates using AI-powered insights",
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline/github_token_checker.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline/production_config.py
RENAMED
File without changes
|
{rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline/utils/file_utils.py
RENAMED
File without changes
|
{rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline/utils/logging_utils.py
RENAMED
File without changes
|
{rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline.egg-info/SOURCES.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
{rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline.egg-info/requires.txt
RENAMED
File without changes
|
{rust_crate_pipeline-1.2.1 → rust_crate_pipeline-1.2.3}/rust_crate_pipeline.egg-info/top_level.txt
RENAMED
File without changes
|
File without changes
|