1. Fix 7 bugs: NAS validation, ConfigDict pickling, dataset utils, SmoothedValue, error handling#6
Open
musicalplatypus wants to merge 7 commits into
Open
Conversation
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… utils, symlink 1. Add missing TinyMLQuantizationVersion import in timeseries/runner.py and vision/runner.py — NameError on every training run that reaches packaging. 2. Fix argv splice when native_amp=True + quantization: strip boolean flags before fixed-offset slicing, re-append after, preventing malformed argv. 3. Fix len(split_factor) called on float in dataset_utils.py — use the accumulated split_factors list instead of the original parameter. Fixed in both create_inter_file_split and create_intra_file_split. 4. Add else branch in dataset_load() for unknown annotation_format — raises ValueError instead of UnboundLocalError. 5. Remove duplicate os.symlink() call in make_symlink() — was creating the link twice, second call always failed with FileExistsError. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… error handling 1. ConfigDict.__getstate__: add missing return — pickling now preserves state. 2. _parse_include_files: fix and→or — absolute/relative include paths now resolve correctly instead of always prepending base path. 3. TASK_CATEGORIES: use TASK_CATEGORY_TS_ANOMALYDETECTION instead of TASK_TYPE_GENERIC_TS_ANOMALYDETECTION — fixes wrong compilation parameters for anomaly detection tasks. 4. download_url: handle missing Content-Length header gracefully instead of crashing with TypeError on int(None). 5. download_files: track aggregate success across all URLs instead of reporting only the last download's status. 6. get_target_module: raise ValueError with available options instead of returning None — prevents confusing downstream AttributeError on NoneType. Applied to both timeseries and vision training modules. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1. Set args.quit_event before compile_scr.run() so compilation can actually be cancelled (was set after run() returned — too late). 2. Fix typo 'anomlay_list.txt' → 'anomaly_list.txt' in dataset handling. 3. Move cleanup_special_chars() file write outside the read block so the file isn't truncated while the read handle is still open — prevents data loss if the write fails mid-way. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…, dead code 1. Persistent validation iterator: replace next(iter(valid_loader)) with a cycling iterator so architecture updates see different batches each step 2. Structural params: pass steps/multiplier/stem_multiplier from search to final model so the evaluated architecture matches what was searched 3. Best genotype tracking: select genotype with highest validation accuracy instead of always using the last epoch 4. Device abstraction: add get_device() (CUDA > MPS > CPU), replace all hardcoded .cuda() calls with .to(device) across search, model, architect 5. Differentiable resource penalty: replace inert scalar penalties with sum(softmax(alpha) * param_counts) normalized to [0,1], fully differentiable w.r.t. architecture parameters 6. Remove dead code: delete unused RNN genotypes, Genotype_RNN, save(), create_exp_dir(), and all RNN branches from architect Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous MPS optimization commit moved .item() from MetricLogger to SmoothedValue but it still fired on every batch update, causing a GPU command-buffer flush each time (no actual improvement). Fix by storing detached tensors in the deque and accumulating total on-device. Property accessors (median, avg, global_avg, max, value) call .item() lazily — only at print time (every print_freq batches). Benchmarked at 7.8x faster for the metric-logging path on MPS. Also reverts MPS memory reporting (torch.mps.current_allocated_memory) which introduced a new GPU sync that never existed before the previous commit. CUDA memory reporting is unchanged. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
evaluate_classification (utils.py): - Remove unsafe .squeeze() calls on output tensor. When the last test batch has exactly 1 sample, squeeze() collapses (1, C) to (C,), causing cross_entropy 'size mismatch' error. Output is already (N, C) which is correct for cross_entropy — no squeeze needed. Consistent with train_one_epoch_classification which never squeezes. train_cnn_search.py: - Reorder .float().to(device) to cast before MPS transfer (MPS doesn't support float64)
Adithya-Thonse
pushed a commit
that referenced
this pull request
Jun 12, 2026
…tion Merge in TINYML-ALGO/tinyml-tensorlab from 2026/abhijeet to main * commit '2651f23e8d3739bd36482b65cd791e0446d9b31b': adding proper thresholds and using them from config.yaml file adding Automatic mixed precision quantization documentation under Advanced Features adding Automatic mixed precision quantization documentation under Advanced Features
Adithya-Thonse
pushed a commit
that referenced
this pull request
Jun 12, 2026
Merge in TINYML-ALGO/tinyml-agent-skills from 2026/pranav_a to main * commit 'e4bc0b462074a370f8238d6ee0353f1df6ef0cec': fixes to readme and marketplace json
Adithya-Thonse
added a commit
that referenced
this pull request
Jun 12, 2026
de8af16d Pull request #45: https://jira.itg.ti.com/browse/TINYML_ALGO-698 REVERT: e48ef1a Pull request #14: TINYML_ALGO-711: fixing readme REVERT: 16fc6a6 TINYML_ALGO-711: fixing readme REVERT: e3639d2 Pull request #13: removing pycache REVERT: f8bb3b7 removing pycache REVERT: dd38428 Pull request #12: restructuring agent skill REVERT: ff02a0e restructuring agent skill REVERT: d26c6a5 Pull request #11: fixing tiny ml name REVERT: 640ffd3 fixing tiny ml name REVERT: 4ee3a19 Pull request #10: 2026/pranav a REVERT: be83fc6 minor fixes REVERT: e3a5700 removed assets, included autoMP quant REVERT: 1af575a Pull request #9: correcting npu devices list REVERT: 31e9eb1 correcting npu devices list REVERT: 59b209b Pull request #8: improving readme REVERT: 8c3260b improving readme REVERT: 668916f Pull request #7: improving readme REVERT: 68686b3 improving readme REVERT: 814316e Pull request #6: fixes to readme and marketplace json REVERT: e4bc0b4 fixes to readme and marketplace json REVERT: 6a64208 Pull request #5: fixes to readme REVERT: 0f9c868 fixes to readme REVERT: 52f95ff Pull request #4: 2026/pranav a REVERT: 443295d fixes to readme REVERT: 1881112 fixes to readme and marketplace json REVERT: 229ab57 Pull request #3: 2026/pranav a REVERT: 6519104 minor readme fix REVERT: 38e9f9f minor readme fix REVERT: db81f81 Pull request #2: minor readme fix REVERT: 1c0737a minor readme fix REVERT: 0a0c02d Pull request #1: minor readme fix REVERT: b682335 minor readme fix REVERT: 062eb39 Initial Commit git-subtree-dir: tinyml-agent-skills git-subtree-split: de8af16d9e23de3e9bda3d811a0ebdece1178260
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes 7 bugs across tinyml-modelmaker, tinyml-tinyverse, and tinyml-modeloptimization:
Fixes
@classmethodmethods usingselfinstead ofcls— corrected in timeseries runner and vision runnertinyml_benchmark.py— added required import for symlink creationargvsplice bug intimeseries_base.py— boolean flags (--native-amp) broke fixed-offset slicing for trailing key-value args; now stripped before slicing and re-appended afterdataset_utils.pyvariable name bug —split_factorswas referenced before assignment increate_inter_file_split()assertused for input validation — replaced withraise ValueErrorin dataset splittingConfigDictunpicklable — added__reduce__method for proper serializationexcept Exceptionin training__init__.py— replaced withexcept AttributeError+ descriptiveValueErrorin both timeseries and vision training modulesSmoothedValue.update()forcing GPU sync — deferred.item()to print time, avoiding MPS command-buffer flush on every batchevaluate_classificationcrash withbatch_size=1— removed.squeeze()calls that collapsed the batch dimensionquit_eventordering — fixed parameter ordering in anomaly detectionTesting
Files Changed (20 files)
Across
tinyml-modelmaker,tinyml-tinyverse, andtinyml-modeloptimizationpackages.