Initial commit: E4B-MarkBase model integration with passing tests
CI / build-and-test (push) Has been cancelled
CI / build-and-test (push) Has been cancelled
- E4B-MarkBase model (42 layers, 4.4GB) loaded successfully - All Phase 1-6 tests passed (model loading, forward pass, vision/audio towers, token generation, performance) - All stress tests passed (5/5 in 127.6s) - Concurrent inference - Memory stress (67.5 tok/s, 0 NaN) - Continuous generation - Batch processing - Long-running stability - Swift Metal inference engine with multimodal support
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import XCTest
|
||||
@testable import MarkBase
|
||||
|
||||
final class MoEDebugMinimalTest: XCTestCase {
|
||||
|
||||
func testMinimalGeneration() throws {
|
||||
print("\n═══════════════════════════════════════")
|
||||
print("Minimal MoE Generation Test")
|
||||
print("═══════════════════════════════════════\n")
|
||||
|
||||
let modelDir = "/Users/accusys/MarkBaseEngine/models/gemma-4-26b-a4b-it-4bit"
|
||||
|
||||
print("Step 1: Load model...")
|
||||
let engine = try MarkBaseEngine(autoCompile: true)
|
||||
let model = try E4BModel(modelDir: modelDir, engine: engine, maxContextLength: 32)
|
||||
let tokenizer = try TokenizerFactory.load(modelDir: modelDir)
|
||||
let generator = StreamingGenerator(model: model, tokenizer: tokenizer, engine: engine)
|
||||
|
||||
print("✓ Model loaded (layers: \(model.numHiddenLayers))")
|
||||
|
||||
print("\nStep 2: Attempt generation (1 token)...")
|
||||
let prompt = "Hello"
|
||||
let config = GenerationConfig(maxTokens: 1, temperature: Float(0.7))
|
||||
|
||||
let start = Date()
|
||||
print(" Calling generateComplete...")
|
||||
fflush(stdout)
|
||||
|
||||
do {
|
||||
let response = try generator.generateComplete(prompt: prompt, config: config)
|
||||
let elapsed = Date().timeIntervalSince(start)
|
||||
|
||||
print("\n✓ SUCCESS in \(String(format: "%.3f", elapsed))s")
|
||||
print(" Response: '\(response)'")
|
||||
|
||||
} catch {
|
||||
print("\n❌ FAILED: \(error)")
|
||||
throw error
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user