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,56 @@
|
||||
import XCTest
|
||||
@testable import MarkBase
|
||||
|
||||
class AllModels26BOnlyTest: XCTestCase {
|
||||
|
||||
func test26BStandardOnly() throws {
|
||||
print("\n═══════════════════════════════════════════════════════════════════")
|
||||
print(" 26B-Standard Only Test")
|
||||
print("═══════════════════════════════════════════════════════════════════\n")
|
||||
|
||||
let engine = try MarkBaseEngine(autoCompile: true)
|
||||
|
||||
let modelPath = "/Users/accusys/MarkBaseEngine/models/gemma-4-26b-standard"
|
||||
|
||||
guard FileManager.default.fileExists(atPath: modelPath) else {
|
||||
print("⚠ Model not found")
|
||||
return
|
||||
}
|
||||
|
||||
print("Testing: 26B-Standard")
|
||||
|
||||
do {
|
||||
print(" Loading model...")
|
||||
let model = try E4BModel(modelDir: modelPath, engine: engine, maxContextLength: 128)
|
||||
print(" ✓ Loaded")
|
||||
print(" Layers: \(model.numHiddenLayers)")
|
||||
print(" Hidden: \(model.hiddenSize)")
|
||||
print(" Vocab: \(model.vocabSize)")
|
||||
|
||||
print(" Testing forward pass...")
|
||||
let result = try model.forwardOptimized(tokenId: 2, position: 0)
|
||||
|
||||
let nanCount = result.filter { $0.isNaN }.count
|
||||
print(" Forward result: NaN=\(nanCount)/\(result.count)")
|
||||
|
||||
if nanCount == 0 {
|
||||
print(" ✓✓✓ Zero NaN - 26B-Standard Success!")
|
||||
} else {
|
||||
print(" ✗ NaN detected in 26B-Standard")
|
||||
}
|
||||
|
||||
print("\n═══════════════════════════════════════════════════════════════════")
|
||||
print(" 26B-Standard Test Passed!")
|
||||
print("═══════════════════════════════════════════════════════════════════\n")
|
||||
|
||||
XCTAssertEqual(nanCount, 0, "26B-Standard should have zero NaN")
|
||||
|
||||
} catch {
|
||||
print(" ✗ Failed: \(error)")
|
||||
print("\n═══════════════════════════════════════════════════════════════════")
|
||||
print(" 26B-Standard Test Failed")
|
||||
print("═══════════════════════════════════════════════════════════════════\n")
|
||||
XCTFail("26B-Standard failed: \(error)")
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user