Skip to content

Commit 0a9126b

Browse files
author
FAST26 Developer
committed
Merge remote-tracking branch 'origin/codex/qihse-file-persistence'
2 parents c88376a + b446538 commit 0a9126b

225 files changed

Lines changed: 92884 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: QIHSE Heterogeneous Build & Test
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build-linux:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Install Build Dependencies
17+
run: |
18+
sudo apt-get update
19+
sudo apt-get install -y build-essential gcc-11 g++-11 libpthread-stubs0-dev
20+
21+
- name: Build Shared Library (AVX2 Enabled)
22+
run: |
23+
cd qihse
24+
make clean
25+
make -j$(nproc)
26+
27+
- name: Verify Library Exports
28+
run: |
29+
nm -D qihse/libqihse.so | grep qihse_search
30+
nm -D qihse/libqihse.so | grep qihse_cuda
31+
32+
- name: Run Core Test Suite
33+
run: |
34+
cd qihse
35+
gcc -Wall -Wextra -I. -I./algorithms tests/qihse_test.c -L. -lqihse -lm -lpthread -o ci_test
36+
LD_LIBRARY_PATH=. ./ci_test
37+
38+
- name: Verify Graceful Fallback
39+
run: |
40+
chmod +x scripts/verify_fallback.sh
41+
./scripts/verify_fallback.sh
42+
43+
- name: Python Smoke Test
44+
run: |
45+
pip install numpy
46+
export LD_LIBRARY_PATH=$PWD/qihse
47+
python3 qihse/python/qihse.py

QIHSE_ADVANCED_VISION.md

Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
# QIHSE Advanced Vision: Self-Optimizing Intelligent Search System
2+
3+
## Vision Overview
4+
5+
QIHSE (Quantum-Inspired Hilbert Space Expansion) has evolved from a simple search algorithm into a comprehensive **self-optimizing, intelligent search ecosystem** that leverages modern hardware architectures for maximum performance and continuous improvement.
6+
7+
## Core Architecture Components
8+
9+
### 1. **UMA Memory Superposition** 🧠
10+
- **Data availability across RAM/GPU/NPU** with intelligent placement
11+
- **128MB Meteor Lake NPU cache optimization**
12+
- **Automatic migration** based on access patterns and temperature
13+
- **Vector database pre-loading** for instant access
14+
15+
### 2. **ML Self-Improvement Engine** 🤖
16+
- **Trained on simulated data** from `tools/vectorrevamp` and `models/`
17+
- **Continuous learning** from real usage patterns
18+
- **Parameter optimization** for dimensions, quantization, hardware selection
19+
- **Adaptive precision** based on accuracy vs. performance trade-offs
20+
21+
### 3. **True Parallel Processing**
22+
- **Beyond first-past-the-post**: Process ALL results simultaneously
23+
- **Advanced aggregation methods**: Weighted voting, phase interference, Bayesian fusion
24+
- **Neural combination** for optimal result synthesis
25+
- **Hardware-accelerated aggregation** on NPU/GPU
26+
27+
### 4. **NPU-Optimized Quantization Pipeline** 🔬
28+
- **INT2/INT4/INT8/FP16/BF16** precision with hardware acceleration
29+
- **Learning-based optimization** that improves over time
30+
- **Meteor Lake NPU integration** utilizing engineering build flags
31+
- **GNA fine-tuning** for micro-optimizations
32+
33+
## Hardware Integration
34+
35+
### Intel Meteor Lake (Your System)
36+
```c
37+
// NPU Cache: 128MB optimized for QIHSE operations
38+
qihse_meteor_lake_npu_cache_init();
39+
40+
// GNA: Gaussian Neural Accelerator for fine-tuning
41+
qihse_meteor_lake_gna_quantization_tune(pipeline, performance_data, samples);
42+
43+
// Engineering build flags enable advanced NPU paths
44+
qihse_meteor_lake_npu_quantization_enable();
45+
```
46+
47+
### Heterogeneous Compute Pool
48+
- **AMX**: GEMM + Conv patterns (1st priority)
49+
- **VNNI**: INT8 quantized dot products (2nd priority)
50+
- **AVX-512F/DQ/VL**: FP32 wide vectors (3rd priority)
51+
- **AVX2+FMA**: Baseline SIMD (fallback)
52+
- **NPU**: OpenVINO-accelerated inference
53+
- **Arc GPU**: oneAPI/SYCL compute
54+
- **NVIDIA GPU**: CUDA acceleration (optional)
55+
56+
## Self-Improvement Loop
57+
58+
```
59+
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
60+
│ User Query │───▶│ QIHSE Search │───▶│ Performance │
61+
│ │ │ + Learning │ │ Metrics │
62+
└─────────────────┘ └──────────────────┘ └─────────────────┘
63+
▲ │ │
64+
│ ▼ │
65+
│ ┌──────────────────┐ │
66+
│ │ ML Optimizer │◀────────────┘
67+
│ │ Retrains │
68+
│ └──────────────────┘
69+
│ │
70+
│ ▼
71+
│ ┌──────────────────┐
72+
└──────────────│ Improved │
73+
│ Parameters │
74+
└──────────────────┘
75+
```
76+
77+
## Key Innovations
78+
79+
### 1. **Memory Superposition**
80+
```c
81+
// Data exists simultaneously across memory hierarchy
82+
qihse_memory_superposition_t* superposition = qihse_uma_create_superposition(
83+
data_size, QIHSE_MEM_NPU_CACHE, true);
84+
85+
// Automatic migration based on access patterns
86+
qihse_uma_access(data_ptr, size, true); // Promote to faster memory
87+
```
88+
89+
### 2. **ML-Driven Optimization**
90+
```c
91+
// Train on simulated data from your tools
92+
qihse_ml_optimizer_t* optimizer = qihse_ml_optimizer_init(
93+
&nn_config, training_samples, num_samples);
94+
95+
// Continuous improvement from real usage
96+
qihse_self_improvement_record(si, &params, &config, actual_speedup, accuracy);
97+
```
98+
99+
### 3. **True Parallel Aggregation**
100+
```c
101+
// Not just winner-takes-all
102+
qihse_parallel_merger_t* merger = qihse_parallel_merger_init(&config);
103+
104+
// Process ALL candidates simultaneously
105+
qihse_parallel_merger_combine(merger, input_results, final_result);
106+
```
107+
108+
### 4. **Adaptive Quantization**
109+
```c
110+
// Learning-based precision selection
111+
qihse_quantization_pipeline_t* pipeline = qihse_quantization_pipeline_create(
112+
"adaptive_quant", QIHSE_QUANT_INT8, true);
113+
114+
// NPU-accelerated with continuous improvement
115+
qihse_npu_quantize_data(input, output, n, mode, params);
116+
```
117+
118+
## Performance Targets
119+
120+
- **100-2000x speedup** over classical algorithms
121+
- **99%+ accuracy** with configurable verification
122+
- **Continuous improvement** through ML optimization
123+
- **Hardware utilization** across all available accelerators
124+
- **Memory efficiency** through intelligent placement and quantization
125+
126+
## Implementation Roadmap
127+
128+
### Phase 1: Core Infrastructure ✅
129+
- [x] Basic QIHSE with fallback mechanisms
130+
- [x] Hardware detection and basic acceleration
131+
- [x] Benchmarking and performance measurement
132+
133+
### Phase 2: Advanced Memory Management ✅
134+
- [x] UMA memory superposition implementation
135+
- [x] Vector database integration
136+
- [x] NPU cache optimization (128MB)
137+
- [x] Automatic migration policies
138+
139+
### Phase 3: ML Self-Improvement 🚧
140+
- [ ] Training data generation from simulations
141+
- [ ] Neural network optimizer implementation
142+
- [ ] Continuous learning from usage patterns
143+
- [ ] Parameter adaptation algorithms
144+
145+
### Phase 4: True Parallel Processing 🚧
146+
- [ ] Advanced result aggregation methods
147+
- [ ] Phase interference models
148+
- [ ] Bayesian fusion algorithms
149+
- [ ] Hardware-accelerated combination
150+
151+
### Phase 5: Quantization Excellence 🚧
152+
- [ ] NPU quantization pipeline
153+
- [ ] Meteor Lake NPU integration
154+
- [ ] GNA fine-tuning capabilities
155+
- [ ] Learning-based precision selection
156+
157+
## API Evolution
158+
159+
### Current (Basic QIHSE)
160+
```c
161+
qihse_config_t config;
162+
qihse_config_init(&config, QIHSE_TYPE_INT64, array_size);
163+
result = qihse_search(data, n, &query, table, &config);
164+
```
165+
166+
### Advanced (Full Ecosystem)
167+
```c
168+
// Initialize complete ecosystem
169+
qihse_quantized_config_t qconfig;
170+
qihse_quantized_config_init(&qconfig, QIHSE_TYPE_INT64, array_size, QIHSE_QUANT_INT8);
171+
172+
// Setup UMA memory management
173+
qihse_memory_superposition_t* mem_super = qihse_uma_create_superposition(size, QIHSE_MEM_NPU_CACHE, true);
174+
175+
// Setup ML optimizer
176+
qihse_self_improvement_t* si = qihse_self_improvement_init("./qihse_learning", 10000);
177+
178+
// Setup true parallel processing
179+
qihse_parallel_merger_t* merger = qihse_parallel_merger_init(&aggregation_config);
180+
181+
// Execute with full optimization
182+
result = qihse_quantized_search(data, n, &query, table, &qconfig);
183+
184+
// Record for learning
185+
qihse_self_improvement_record(si, &params, &qconfig.base_config, speedup, accuracy);
186+
```
187+
188+
## Hardware-Specific Optimizations
189+
190+
### Your Meteor Lake System
191+
- **NPU Cache**: 128MB optimized for QIHSE data structures
192+
- **GNA**: Fine-tuning for quantization parameters
193+
- **AMX**: Matrix operations for Hilbert space projections
194+
- **VNNI**: Accelerated quantization operations
195+
- **Engineering Flags**: Enable experimental NPU features
196+
197+
### Scaling to Other Systems
198+
- **AMD**: Utilize Ryzen AI NPU and 3D V-Cache
199+
- **NVIDIA**: RTX/RTX Ada GPUs with CUDA acceleration
200+
- **ARM**: Ethos NPU and Mali GPU integration
201+
- **Cloud**: Multi-instance parallel processing
202+
203+
## Research Integration
204+
205+
### Simulated Data Sources
206+
- `tools/vectorrevamp/`: Generate diverse vector patterns
207+
- `models/`: ML model training data and architectures
208+
- `tools/POLYGOTTEM/`: Advanced data generation techniques
209+
210+
### Continuous Learning
211+
- **Online Learning**: Adapt to new data patterns
212+
- **Transfer Learning**: Apply optimizations across domains
213+
- **Meta-Learning**: Learn how to optimize different algorithms
214+
215+
## Future Extensions
216+
217+
### Quantum Integration
218+
- **DSMIL Device 46**: Local quantum simulation (30 qubits)
219+
- **Hybrid Algorithms**: Classical-quantum search hybrids
220+
- **Quantum ML**: Variational quantum circuits for optimization
221+
222+
### Advanced Analytics
223+
- **Performance Prediction**: ML models that predict optimal configurations
224+
- **Workload Characterization**: Automatic data pattern analysis
225+
- **Hardware Modeling**: Simulate different hardware configurations
226+
227+
### Distributed Search
228+
- **Multi-Node Coordination**: Search across multiple systems
229+
- **Federated Learning**: Privacy-preserving optimization sharing
230+
- **Edge Computing**: Optimized for resource-constrained devices
231+
232+
## Conclusion
233+
234+
QIHSE has evolved from a quantum-inspired search algorithm into a **comprehensive intelligent search ecosystem** that:
235+
236+
1. **Learns and adapts** to hardware capabilities and data patterns
237+
2. **Utilizes all available compute resources** simultaneously
238+
3. **Optimizes memory placement** across heterogeneous hierarchies
239+
4. **Continuously improves** through machine learning
240+
5. **Provides true parallel processing** beyond simple winner-takes-all approaches
241+
242+
This represents the future of search algorithms: **not just faster, but intelligently adaptive and self-optimizing systems** that leverage the full potential of modern hardware architectures.
243+
244+
---
245+
246+
*This vision represents the convergence of quantum-inspired algorithms, machine learning, heterogeneous computing, and advanced memory management into a unified, intelligent search platform.*

QIHSE_PUBLIC_KEY.asc

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
-----BEGIN PGP PUBLIC KEY BLOCK-----
2+
3+
mQINBGnB1JEBEADHMM656rXAnbyOjoLbjUH5rGkWuubYnzivPHSvdasE8+xaHVpk
4+
5qEm3il6fHT25zNuXeFWKUJ2EOzR0M9eg1ReF1vKUVwiT/w4IEhokisP6cv1Onnd
5+
pPw8ihTjJa3o+DErh0GP++8Bq7/ZjdTs/6q1wEW09d1WjfhMF8zEnPvSDCm32q30
6+
2Ze2phF+4XJpARUAIVQYN86hiVmmKGCYtr5izmQjKgIu+6JzaQn0uEu+ZUNhoeF1
7+
jBURimxI4866QxkQKbqKE8I3eSAXzELLbTuojNLCaTGs6kX14XaNT2IhgYA+bzwn
8+
MAG+TVTUsTsn5Iqi2egwAtBv5ApvGS9rN4YvEWPVCXdHZx6oM8/UV5CoPCPErRYa
9+
7hA2DuKbEqLznkQbBKRSoYBtNI1Cy6iFAUb4W+PCFD484UljxWOjWkf9yozYdaW3
10+
b9k48EElANM0srhnvpmbWUrcSe6XVHMODa3i+eSkdaBBA6nvR86oqJGPVQnO+5rq
11+
CazSPXzfr4Beo4JBY7aaMOwlboUX914HMKh7YkEAKQNXYxbvqzY7zAATmXKcd6Yo
12+
yCG6yX5HT+1KZmtsWGCOKehvW7PHfGNXz1HaG9jqyaaC9Kob/sUolfCkPNPoBf45
13+
tRAcAeqm/cV/19397DzGNRSE2AKD/wn3Ly8vWudL1M9oO1CCyMYc+HMrVQ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hyIKOAH9Q2xuqkDB2hANA9
62+
=EPPH
63+
-----END PGP PUBLIC KEY BLOCK-----

build/bin/dsmil_benchmark

26 KB
Binary file not shown.

build/bin/dsmil_integration_test

26.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)