i am making a custom inference engine in C for deepseek v3. I have loaded the weights.…
- User
i am making a custom inference engine in C for deepseek v3. I have loaded the weights. However, some weights dont match the ones that i sent to my pytorch model. the difference happens after layer 0. most values are same but some values are not same when compared to weights sent to C code: Python: Q_A: tensor([ 2.3050e-04, -2.9504e-03, -9.2200e-04, -2.2128e-03, 3.4421e-03, 5.4090e-03, 2.7660e-04, 5.9008e-03, -6.8842e-03, 1.8440e-03, -7.3760e-03, 2.7045e-03, 1.1802e-02, -3.1963e-03, 4.6100e-04, -2.4587e-03, -1.2785e-02, 1.9669e-03, -8.8512e-03, 4.3027e-04, -2.7045e-03, 4.4256e-03, 1.8440e-03, -6.1466e-04, 4.4256e-03, -2.4587e-03, -7.8677e-03, 3.0733e-04, -1.9977e-04, -7.3760e-03, 7.8677e-03, -2.4587e-04, 1.2293e-03, -5.4090e-03, 1.9669e-03, 5.4090e-03, -9.8346e-03, -1.1064e-03, -9.8346e-03, 1.5981e-03, -1.8440e-03, -9.9883e-05, -1.2785e-02, 5.9008e-03, 1.0818e-02, -2.7660e-04, 1.9669e-02, 7.2031e-06, 3.1963e-03, -1.2293e-03, -3.6880e-03, 1.8440e-03, -4.9173e-04, 3.9339e-03, 3.6880e-03, -6.1466e-04, -7.3760e-03, -3.9339e-03, 5.5320e-04, -6.8842e-03, -2.7045e-03, 8.6053e-04, -2.7045e-03, 2.9504e-03, 1.5981e-03, -1.3523e-03, -3.9339e-03, 2.4587e-03, -7.3760e-03, 3.9339e-03, 9.2200e-04, 1.7211e-03, 7.8677e-03, -1.2293e-03, -5.4090e-03, -7.8677e-03, -3.9339e-03, -2.2128e-03, 2.2128e-03, 1.5981e-03, -4.9173e-04, -5.4090e-03, 2.2128e-03, 1.5735e-02, -6.8842e-03, -6.8842e-03, 5.9008e-03, 1.5981e-03, 4.6100e-04, 8.8512e-03, 9.8346e-03, 5.9008e-03, -1.5735e-02, -3.1963e-03, 1.2293e-03, -4.4256e-03, 2.7045e-03, -7.3760e-04, 5.9008e-03, -3.1963e-03]) C code: Q_A:[ 0.000123, -0.002950, -0.000861, -0.002213, 0.003442, 0.005409, 0.000246, 0.005901, -0.006884, 0.001844, -0.007376, 0.002705, 0.011802, -0.003196, 0.000369, -0.002459, -0.012785, 0.001967, -0.008851, 0.000369, -0.002705, 0.004426, 0.001844, -0.000615, 0.004426, -0.002459, -0.007868, 0.000246, -0.000123, -0.007376, 0.007868, -0.000246, 0.001229, -0.005409, 0.001967, 0.005409, -0.009835, -0.001106, -0.009835, 0.001598, -0.001844, 0.000000, -0.012785, 0.005901, 0.010818, -0.000246, -0.011802, 0.000000, 0.003196, -0.001229, -0.003688, 0.001844, -0.000492, 0.003934, 0.003688, -0.000615, -0.007376, -0.003934, 0.000492, -0.006884, -0.002705, 0.000861, -0.002705, 0.002950, 0.001598, -0.001352, -0.003934, 0.002459, -0.007376, 0.003934, 0.000861, 0.001721, 0.007868, -0.001229, -0.005409, -0.007868, -0.003934, -0.002213, 0.002213, 0.001598, -0.000492, -0.005409, 0.002213, -0.015735, -0.006884, -0.006884, 0.005901, 0.001598, 0.000369, 0.008851, 0.009835, 0.005901, -0.015735, -0.003196, 0.001229, -0.004426, 0.002705, -0.000738, 0.005901, -0.003196, ]
All weights are from Huggingface but were dequantized
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.