okami.mom/strata

git clone https://git.nkp.pet/okami.mom/strata

Niko1221Merge f-own-2b (cc8c29f31) into f-own-int: our own GGUF reader/writer and quantizers (gguf-py out of the pack tools)0f1e5e4cb

main
20.3 KiB420 linesraw
1"""tools/test_strata_gguf.py - Strata's own GGUF reader/writer and quantizers (tools/strata_gguf.py, tools/strata_quants.py).
2
3    python tools/test_strata_gguf.py [-v]            run the tests
4    python tools/test_strata_gguf.py --freeze        rewrite tools/strata_gguf_digests.json from gguf-py's outputs (needs gguf-py)
5
6What is proven:
7  * tools/strata_quant_tables.py is exactly what tools/gen_strata_quant_tables.py makes from strata-quant-common.h;
8  * the type table agrees with tools/gguf_reader.py and (when it is available) with gguf-py;
9  * with llama.cpp's gguf-py (third_party/strata-gguf-py, or $STRATA_GGUF_PY): every dequantizer and quantizer gives bit-identical results
10    on random and edge-case blocks, the writer produces byte-identical files, and the reader gives the same fields and tensors;
11  * without gguf-py: the same inputs give the digests recorded from gguf-py (tools/strata_gguf_digests.json), so the exactness stays checked
12    after the vendored copy is gone.
13"""
14from __future__ import annotations
15
16import hashlib
17import importlib
18import json
19import os
20import struct
21import sys
22import contextlib
23import gc
24import shutil
25import tempfile
26import unittest
27from pathlib import Path
28
29import numpy as np
30
31HERE = Path(__file__).resolve().parent
32ROOT = HERE.parent
33sys.path.insert(0, str(HERE))
34import gen_strata_quant_tables as GEN  # noqa: E402
35import gguf_reader as GR  # noqa: E402
36import strata_gguf as SG  # noqa: E402
37import strata_quants as SQ  # noqa: E402
38
39DIGESTS = HERE / "strata_gguf_digests.json"
40
41#: byte offsets of the fp16 fields of each block type (set to finite values so the comparison is not about NaN payloads)
42FP16_AT = {"Q4_0": (0,), "Q4_1": (0, 2), "Q5_0": (0,), "Q5_1": (0, 2), "Q8_0": (0,), "Q2_K": (80, 82), "Q3_K": (108,), "Q4_K": (0, 2),
43           "Q5_K": (0, 2), "Q6_K": (208,), "TQ1_0": (52,), "TQ2_0": (64,), "IQ2_XXS": (0,), "IQ2_XS": (0,), "IQ2_S": (0,),
44           "IQ3_XXS": (0,), "IQ3_S": (0,), "IQ1_S": (0,), "IQ4_NL": (0,), "IQ4_XS": (0,), "Q2_0": (0,), "MXFP4": (), "NVFP4": (), "IQ1_M": ()}
45DEQ_TYPES = sorted(FP16_AT)
46QUANT_TYPES = ("BF16", "Q8_0", "Q4_0", "Q4_1", "Q5_0", "Q5_1")
47
48
49def load_gguf_py():
50    for c in (os.environ.get("STRATA_GGUF_PY"), ROOT / "third_party" / "strata-gguf-py"):
51        if c and (Path(c) / "gguf" / "__init__.py").is_file():
52            if str(c) not in sys.path:
53                sys.path.insert(0, str(c))
54            return importlib.import_module("gguf")
55    return None
56
57
58GGUF = load_gguf_py()
59
60
61def blocks_for(name: str, seed: int, n: int = 48) -> np.ndarray:
62    """n random blocks of the type with finite fp16 scales, plus all-zero, all-0xFF and all-0x55 blocks"""
63    bs, ts = SQ.BLOCK[name]
64    rng = np.random.default_rng(seed)
65    b = rng.integers(0, 256, size=(n, ts), dtype=np.uint8)
66    b[0] = 0
67    b[1] = 0xFF
68    b[2] = 0x55
69    for off in FP16_AT[name]:
70        h = rng.normal(0, 0.7, size=(n,)).astype(np.float16)
71        h[3] = np.float16(0)
72        h[4] = np.float16(6e-5)         # smallest normal
73        h[5] = np.float16(1e-7)         # subnormal
74        h[6] = np.float16(-2.5)
75        b[:, off:off + 2] = h.view(np.uint8).reshape(n, 2)
76    if name == "IQ1_M":                 # the fp16 scale is spread over the top nibbles of four uint16 words at bytes 48..55
77        h = rng.normal(0, 0.7, size=(n,)).astype(np.float16).view(np.uint16)
78        for k in range(4):
79            w = b[:, 48 + 2 * k:50 + 2 * k].copy().view(np.uint16).reshape(n)
80            w = (w & np.uint16(0x0FFF)) | (((h >> np.uint16(4 * k)) & np.uint16(0xF)) << np.uint16(12))
81            b[:, 48 + 2 * k:50 + 2 * k] = w.astype("<u2").view(np.uint8).reshape(n, 2)
82    if name == "MXFP4":
83        b[3:, 0] = rng.integers(100, 140, size=(n - 3,), dtype=np.uint8)     # e8m0 scales around 1
84    if name == "NVFP4":
85        b[3:, :4] = rng.integers(1, 0x7E, size=(n - 3, 4), dtype=np.uint8)   # ue4m3 scales, 0 and 0x7F are the special ones (rows 0..2)
86    return b
87
88
89def floats_for(seed: int, cols: int = 64, rows: int = 40) -> np.ndarray:
90    """float32 rows with many scales, zero rows, constant rows, exact halves, negative zero"""
91    rng = np.random.default_rng(seed)
92    x = rng.normal(0, 1, size=(rows, cols)).astype(np.float32) * (10.0 ** rng.integers(-4, 4, size=(rows, 1))).astype(np.float32)
93    x[0] = 0
94    x[1] = 1.5
95    x[2] = -np.float32(0.0)
96    x[3] = np.float32(np.arange(cols) % 5) / np.float32(2)               # exact halves: the rounding ties
97    x[4] = -x[3]
98    x[5, :cols // 2] = 0
99    x[6] = np.float32(1e-30)
100    return x
101
102
103def special_floats() -> np.ndarray:
104    v = np.array([0.0, -0.0, 1.0, -1.0, 1.0000001, 65504.0, 3.4e38, -3.4e38, 1e-40, -1e-40, np.inf, -np.inf, np.nan, 0.15625, 3.0517578e-05,
105                  1.00390625, 1.00585938, 1.0078125, 2.5, 3.5], dtype=np.float32)
106    return v.reshape(1, -1)
107
108
109@contextlib.contextmanager
110def tmpdir():
111    """a temporary folder; the readers' memmaps are dropped first (Windows cannot delete a mapped file)"""
112    d = tempfile.mkdtemp(prefix="strata_gguf_")
113    try:
114        yield d
115    finally:
116        gc.collect()
117        shutil.rmtree(d, ignore_errors=True)
118
119
120def sha(a: np.ndarray) -> str:
121    return hashlib.sha256(np.ascontiguousarray(a).tobytes()).hexdigest()
122
123
124def outputs(lib) -> dict:
125    """every deterministic output the tests compare, as sha256, computed with `lib` (a gguf-py module or strata_gguf)"""
126    Q = lib.GGMLQuantizationType
127    out = {}
128    for name in DEQ_TYPES:
129        if lib is GGUF and name == "Q2_0":
130            continue                      # gguf-py has no dequantizer for Q2_0
131        for seed in (1, 2, 3):
132            b = blocks_for(name, seed)
133            out["deq/%s/%d" % (name, seed)] = sha(lib.quants.dequantize(b.reshape(4, -1), Q[name]).astype(np.float32).view(np.uint32))
134    for name in QUANT_TYPES:
135        bs = SQ.BLOCK[name][0]
136        for seed in (1, 2):
137            x = floats_for(seed, cols=64)
138            out["q/%s/%d" % (name, seed)] = sha(lib.quants.quantize(x, Q[name]))
139        out["q/%s/special" % name] = sha(lib.quants.quantize(np.repeat(special_floats(), 2, axis=1)[:, :32].copy().reshape(1, 32), Q[name]))
140    return out
141
142
143class Tables(unittest.TestCase):
144    def test_generated_tables_are_current(self):
145        self.assertEqual((HERE / "strata_quant_tables.py").read_text(encoding="utf-8"), GEN.render(),
146                         "tools/strata_quant_tables.py is stale: python tools/gen_strata_quant_tables.py")
147
148    def test_the_type_tables_agree(self):
149        for t, (bs, ts) in SG.GGML_QUANT_SIZES.items():
150            if t.name in SQ.BLOCK:
151                self.assertEqual(SQ.BLOCK[t.name], (bs, ts), t.name)
152            if t.name in GR.BLOCK_GEOMETRY:
153                self.assertEqual(GR.BLOCK_GEOMETRY[t.name], (bs, ts), t.name)
154        for tid, nm in GR.GGML_TYPES.items():
155            if nm in SG.GGMLQuantizationType.__members__ and tid not in (41,):
156                self.assertEqual(int(SG.GGMLQuantizationType[nm]), tid, nm)
157
158    def test_the_type_table_matches_gguf_py(self):
159        if GGUF is None:
160            self.skipTest("no gguf-py")
161        for t, v in GGUF.GGML_QUANT_SIZES.items():
162            self.assertEqual(SG.GGML_QUANT_SIZES[SG.GGMLQuantizationType(int(t))], v, t.name)
163            self.assertEqual(SG.GGMLQuantizationType[t.name].value, t.value)
164
165
166class Oracle(unittest.TestCase):
167    """bit-identical to gguf-py"""
168
169    def run(self, result=None):
170        with np.errstate(all="ignore"):         # the all-0xFF blocks overflow to inf in both implementations
171            return super().run(result)
172
173    def setUp(self):
174        if GGUF is None:
175            self.skipTest("no gguf-py (third_party/strata-gguf-py or STRATA_GGUF_PY)")
176
177    def test_dequantize_is_bit_identical(self):
178        for name in DEQ_TYPES:
179            if name == "Q2_0":
180                continue
181            for seed in (1, 2, 3, 4):
182                b = blocks_for(name, seed).reshape(4, -1)
183                want = GGUF.quants.dequantize(b, GGUF.GGMLQuantizationType[name]).astype(np.float32)
184                got = SG.quants.dequantize(b, SG.GGMLQuantizationType[name])
185                self.assertEqual(got.shape, want.shape, name)
186                self.assertEqual(got.dtype, np.float32)
187                self.assertTrue(np.array_equal(got.view(np.uint32), want.view(np.uint32)), "%s seed %d" % (name, seed))
188
189    def test_dequantize_handles_chunking_and_shapes(self):
190        b = blocks_for("Q4_K", 9, n=300)
191        want = GGUF.quants.dequantize(b.reshape(3, 100 * 144), GGUF.GGMLQuantizationType.Q4_K)
192        old = SQ._CHUNK_ELEMS
193        SQ._CHUNK_ELEMS = 256 * 7
194        try:
195            got = SG.quants.dequantize(b.reshape(3, 100 * 144), SG.GGMLQuantizationType.Q4_K)
196        finally:
197            SQ._CHUNK_ELEMS = old
198        self.assertTrue(np.array_equal(got.view(np.uint32), want.view(np.uint32)))
199
200    def test_float_types_pass_through(self):
201        x = np.arange(12, dtype=np.float32)
202        for t in ("F32", "F16"):
203            raw = x.astype(np.float32 if t == "F32" else np.float16).view(np.uint8)
204            self.assertTrue(np.array_equal(SG.quants.dequantize(raw, SG.GGMLQuantizationType[t]), GGUF.quants.dequantize(raw, GGUF.GGMLQuantizationType[t])))
205
206    def test_quantize_is_bit_identical(self):
207        for name in QUANT_TYPES:
208            for seed in (1, 2, 3, 4):
209                x = floats_for(seed, cols=96 if name != "BF16" else 50)
210                if name != "BF16":
211                    x = x[:, :64] if name in ("Q8_0", "Q4_0", "Q4_1", "Q5_0", "Q5_1") else x
212                want = GGUF.quants.quantize(x, GGUF.GGMLQuantizationType[name])
213                got = SG.quants.quantize(x, SG.GGMLQuantizationType[name])
214                self.assertEqual(got.shape, want.shape, name)
215                self.assertTrue(np.array_equal(got, want), "%s seed %d" % (name, seed))
216
217    def test_bf16_specials_and_rounding_ties(self):
218        rng = np.random.default_rng(5)
219        bits = rng.integers(0, 2 ** 32, size=(8, 4096), dtype=np.uint64).astype(np.uint32)
220        bits[0, :8] = [0x3F808000, 0x3F818000, 0x3F800000, 0x7F800000, 0xFF800000, 0x7FC00001, 0x7F800001, 0x00000001]   # ties, inf, NaNs, subnormal
221        x = bits.view(np.float32)
222        want = GGUF.quants.quantize(x, GGUF.GGMLQuantizationType.BF16)
223        got = SG.quants.quantize(x, SG.GGMLQuantizationType.BF16)
224        self.assertTrue(np.array_equal(got, want))
225        self.assertTrue(np.array_equal(SG.quants.quantize(special_floats(), SG.GGMLQuantizationType.BF16), GGUF.quants.quantize(special_floats(), GGUF.GGMLQuantizationType.BF16)))
226
227    def test_quantize_roundtrip_is_the_same(self):
228        x = floats_for(8, cols=64)
229        for name in QUANT_TYPES:
230            a = SG.quants.dequantize(SG.quants.quantize(x, SG.GGMLQuantizationType[name]), SG.GGMLQuantizationType[name])
231            b = GGUF.quants.dequantize(GGUF.quants.quantize(x, GGUF.GGMLQuantizationType[name]), GGUF.GGMLQuantizationType[name])
232            self.assertTrue(np.array_equal(a.view(np.uint32), b.view(np.uint32)), name)
233
234
235def write_sample(lib, path, alignment=None):
236    Q = lib.GGMLQuantizationType
237    V = lib.GGUFValueType
238    w = lib.GGUFWriter(path, "qwen4exp")
239    if alignment:
240        w.add_custom_alignment(alignment)
241    w.add_string("general.name", "sample")
242    w.add_string("empty.skipped", "")
243    w.add_uint32("a.u32", 7)
244    w.add_int32("a.i32", -7)
245    w.add_uint16("split.no", 1)
246    w.add_uint64("a.u64", 2 ** 40)
247    w.add_int8("a.i8", -3)
248    w.add_float32("a.f32", 0.1)
249    w.add_float64("a.f64", 0.1)
250    w.add_bool("a.bool", True)
251    w.add_array("a.strs", ["x", "yy", "zzzé"])
252    w.add_array("a.ints", [1, 2, 3])
253    w.add_array("a.floats", [0.5, 1.5])
254    w.add_key_value("a.u8s", [1, 2, 255], V.ARRAY, sub_type=V.UINT8)
255    w.add_key_value("a.u32s", [1, 2, 4294967295], V.ARRAY, sub_type=V.UINT32)
256    w.add_key_value("a.bools", [True, False], V.ARRAY, sub_type=V.BOOL)
257    w.add_key_value("a.guess", 3, V.INT32)
258    rng = np.random.default_rng(3)
259    w.add_tensor("t.f32", rng.normal(size=(3, 5)).astype(np.float32))
260    w.add_tensor("t.f16", rng.normal(size=(2, 7)).astype(np.float16))
261    w.add_tensor("t.i32", np.arange(6, dtype=np.int32).reshape(2, 3))
262    w.add_tensor("t.f64", rng.normal(size=(4,)))
263    x = rng.normal(size=(5, 64)).astype(np.float32)
264    w.add_tensor("t.q8", lib.quants.quantize(x, Q.Q8_0), raw_dtype=Q.Q8_0)
265    w.add_tensor("t.q8raw", np.zeros((3, 68), np.uint8), raw_dtype=Q.Q8_0, raw_shape=[3, 68])
266    w.add_tensor("t.bf16", rng.integers(0, 65535, size=(4, 6), dtype=np.uint16), raw_dtype=Q.BF16)
267    w.add_tensor("t.q4k3d", rng.integers(0, 255, size=(2, 3, 144), dtype=np.uint8), raw_dtype=Q.Q4_K)
268    w.add_tensor("t.q2_0", rng.integers(0, 255, size=(2, 18), dtype=np.uint8), raw_dtype=Q.Q2_0)
269    w.write_header_to_file()
270    w.write_kv_data_to_file()
271    w.write_tensors_to_file()
272    w.close()
273
274
275class Container(unittest.TestCase):
276    def test_a_file_written_here_reads_back(self):
277        with tmpdir() as d:
278            p = Path(d) / "a.gguf"
279            write_sample(SG, p)
280            r = SG.GGUFReader(p)
281            self.assertEqual(r.alignment, 32)
282            self.assertEqual(r.data_offset % 32, 0)
283            self.assertEqual(r.fields["general.architecture"].contents(), "qwen4exp")
284            self.assertEqual(r.fields["a.strs"].contents(), ["x", "yy", "zzzé"])
285            self.assertEqual(r.fields["a.strs"].contents(1), "yy")
286            self.assertEqual(r.fields["a.ints"].types, [SG.GGUFValueType.ARRAY, SG.GGUFValueType.INT32])
287            self.assertEqual(r.fields["a.u64"].contents(), 2 ** 40)
288            self.assertIs(r.fields["a.bool"].contents(), True)
289            self.assertAlmostEqual(r.fields["a.f32"].contents(), 0.1, places=7)
290            self.assertNotIn("empty.skipped", r.fields)
291            t = {x.name: x for x in r.tensors}
292            self.assertEqual(t["t.f32"].data.shape, (3, 5))
293            self.assertEqual([int(v) for v in t["t.f32"].shape], [5, 3])
294            self.assertEqual(t["t.q8"].data.shape, (5, 2 * 34))
295            self.assertEqual(t["t.q8"].n_bytes, 5 * 2 * 34)
296            self.assertEqual(t["t.bf16"].data.dtype, np.uint8)
297            self.assertEqual(t["t.bf16"].data.shape, (4, 12))
298            self.assertEqual(t["t.q4k3d"].data.shape, (2, 3, 144))
299            self.assertEqual(t["t.q2_0"].tensor_type, SG.GGMLQuantizationType.Q2_0)
300            self.assertEqual(t["t.i32"].data.tolist(), [[0, 1, 2], [3, 4, 5]])
301            for x in r.tensors:
302                self.assertEqual(x.data_offset % 32, 0)
303
304    def test_malformed_files_are_refused(self):
305        with tmpdir() as d:
306            p = Path(d) / "a.gguf"
307            write_sample(SG, p)
308            raw = p.read_bytes()
309            for name, data in (("magic", b"XXXX" + raw[4:]), ("version", raw[:4] + struct.pack("<I", 9) + raw[8:]),
310                               ("short", raw[:30]), ("cut", raw[:-40]), ("empty", b"GGUF"),
311                               ("count", raw[:8] + struct.pack("<Q", 2 ** 62) + raw[16:])):
312                q = Path(d) / (name + ".gguf")
313                q.write_bytes(data)
314                with self.assertRaises((ValueError, KeyError), msg=name):
315                    SG.GGUFReader(q)
316
317    def test_the_writer_refuses_what_gguf_py_refuses(self):
318        w = SG.GGUFWriter(None, "x")
319        w.add_tensor("a", np.zeros(4, np.float32))
320        with self.assertRaises(ValueError):
321            w.add_tensor("a", np.zeros(4, np.float32))
322        with self.assertRaises(ValueError):
323            w.add_tensor("b", np.zeros(4, np.uint8))
324        with self.assertRaises(ValueError):
325            w.add_tensor("c", np.zeros((2, 33), np.uint8), raw_dtype=SG.GGMLQuantizationType.Q8_0)
326        with self.assertRaises(NotImplementedError):
327            SG.GGUFWriter(None, "x", split_max_tensors=2)
328
329    def test_files_are_byte_identical_to_gguf_py(self):
330        if GGUF is None:
331            self.skipTest("no gguf-py")
332        with tmpdir() as d:
333            for align in (None, 64):
334                a, b = Path(d) / "ours.gguf", Path(d) / "theirs.gguf"
335                write_sample(SG, a, align)
336                write_sample(GGUF, b, align)
337                self.assertEqual(a.read_bytes(), b.read_bytes(), "alignment %s" % align)
338
339    def test_the_reader_agrees_with_gguf_py(self):
340        if GGUF is None:
341            self.skipTest("no gguf-py")
342        with tmpdir() as d:
343            p = Path(d) / "a.gguf"
344            write_sample(GGUF, p, 64)
345            ours, theirs = SG.GGUFReader(p), GGUF.GGUFReader(p)
346            self.assertEqual(ours.alignment, theirs.alignment)
347            self.assertEqual(ours.data_offset, theirs.data_offset)
348            self.assertEqual(list(ours.fields), list(theirs.fields))
349            for k, f in theirs.fields.items():
350                g = ours.fields[k]
351                self.assertEqual([int(t) for t in g.types], [int(t) for t in f.types], k)
352                self.assertEqual(g.contents(), f.contents(), k)
353                self.assertEqual(type(g.contents()), type(f.contents()), k)
354            self.assertEqual([t.name for t in ours.tensors], [t.name for t in theirs.tensors])
355            for a, b in zip(ours.tensors, theirs.tensors):
356                self.assertEqual(int(a.tensor_type), int(b.tensor_type))
357                self.assertEqual(a.tensor_type.name, b.tensor_type.name)
358                self.assertEqual((a.n_elements, a.n_bytes, a.data_offset), (b.n_elements, b.n_bytes, b.data_offset), a.name)
359                self.assertEqual([int(v) for v in a.shape], [int(v) for v in b.shape])
360                self.assertEqual((a.field.offset, a.field.name), (b.field.offset, b.field.name), a.name)
361                self.assertEqual(a.data.shape, b.data.shape, a.name)
362                self.assertEqual(a.data.dtype, b.data.dtype, a.name)
363                self.assertTrue(np.array_equal(np.asarray(a.data).view(np.uint8), np.asarray(b.data).view(np.uint8)), a.name)
364
365    def test_the_slim_copy_loop_is_the_same(self):
366        """tools/nvfp4_local_pack.py cmd_slim: every KV and every tensor of a file copied through reader + writer"""
367        with tmpdir() as d:
368            src = Path(d) / "src.gguf"
369            write_sample(SG, src)
370            outs = []
371            for lib in [SG] + ([GGUF] if GGUF is not None else []):
372                rd = lib.GGUFReader(src)
373                w = lib.GGUFWriter(Path(d) / ("o%d.gguf" % len(outs)), rd.fields["general.architecture"].contents())
374                for key, f in rd.fields.items():
375                    if key.startswith("GGUF.") or key == "general.architecture":
376                        continue
377                    vt = f.types[0]
378                    w.add_key_value(key, f.contents(), vt, sub_type=f.types[-1] if vt == lib.GGUFValueType.ARRAY else None)
379                for t in rd.tensors:
380                    data = np.asarray(t.data)
381                    if t.tensor_type in (lib.GGMLQuantizationType.F32, lib.GGMLQuantizationType.F16):
382                        w.add_tensor(t.name, data)
383                    else:
384                        raw = np.ascontiguousarray(data).view(np.uint8)
385                        w.add_tensor(t.name, raw, raw_dtype=t.tensor_type, raw_shape=[int(x) for x in raw.shape])
386                w.write_header_to_file()
387                w.write_kv_data_to_file()
388                w.write_tensors_to_file()
389                w.close()
390                del rd
391                outs.append(Path(d) / ("o%d.gguf" % len(outs)))
392            for o in outs[1:]:
393                self.assertEqual(outs[0].read_bytes(), o.read_bytes())
394
395
396class Frozen(unittest.TestCase):
397    """the outputs recorded from gguf-py (tools/strata_gguf_digests.json): the check that remains once gguf-py is not in the tree"""
398
399    def run(self, result=None):
400        with np.errstate(all="ignore"):
401            return super().run(result)
402
403    def test_outputs_match_the_recorded_digests(self):
404        want = json.loads(DIGESTS.read_text(encoding="utf-8"))
405        got = outputs(SG)
406        for k, v in want.items():
407            if k in got:
408                self.assertEqual(got[k], v, k)
409        self.assertEqual(sorted(k for k in want if k not in got), [], "recorded outputs we do not compute")
410        self.assertEqual(sorted(k for k in got if k not in want and not k.startswith("deq/Q2_0/")), [], "outputs not recorded: run --freeze")
411
412
413if __name__ == "__main__":
414    if "--freeze" in sys.argv:
415        if GGUF is None:
416            sys.exit("--freeze needs gguf-py (third_party/strata-gguf-py or STRATA_GGUF_PY)")
417        DIGESTS.write_text(json.dumps(outputs(GGUF), indent=1, sort_keys=True) + "\n", encoding="utf-8", newline="\n")
418        print("wrote", DIGESTS)
419        sys.exit(0)
420    unittest.main(argv=[a for a in sys.argv if a != "--freeze"])