Skip to content

fix(qc,#16795): research Mamba-Crypto-Ranking — déterminisme explicite + re-exécution quasi-bit-identique - #16823

Merged
jsboige merged 1 commit into
mainfrom
feature/qcdet-research-4
Sep 21, 2026
Merged

jsboige merged 1 commit into
mainfrom
feature/qcdet-research-4

Conversation

@jsboige

@jsboige jsboige commented Sep 19, 2026

Copy link
Copy Markdown
Owner

Grain: DEEP/qc -- lane myia-po-2026:CoursIA -- prev: DEEP/qc #16822

research Mamba-Crypto-Ranking : déterminisme explicite + re-exécution quasi-bit-identique

Tranche 12 du volet QuantConnect de #16795. Candidat re-vérifié firsthand : seeds posés (cellule 1 global 42 + cellule 10 re-seed + cellule 15 par-seed de la boucle walk-forward), AUCUN réglage de déterminisme, CPU-only pinné par l'auteur, aucun QuantBook (exécution locale légitime). 5-fold × 4 seeds × 3 modèles (Mamba selective SSM, DLinear, TFT-Lite).

Le fix (cellule 1, import torch)

import os
os.environ.setdefault('CUBLAS_WORKSPACE_CONFIG', ':4096:8')  # avant import torch
# après le bloc seeds global :
torch.backends.cudnn.deterministic = True
torch.backends.cudnn.benchmark = False
torch.use_deterministic_algorithms(True, warn_only=True)

Les seeds existants (global + par-seed de la boucle) restent inchangés.

Preuve d'exécution (C.2)

Papermill 11/11 cellules code, kernel coursia-ml-training, 0 erreur
Periode: 2017-11-09 a 2024-12-31 | Jours: 2610 (fenêtre pinnée par le code, inchangée)

Reproductibilité — lignes de verdict quasi-bit-identiques

Ligne verdict Avant (committé) Cette PR
Benchmark BH Sharpe 0.74 0.74 (identique)
Mamba Sharpe=0.000, Edge=-0.740, z=0.00 → INCONCLUSIVE identique
DLinear Sharpe=-0.011, Edge=-0.751, z=-2.64 → NO BEATS identique
TFT-Lite Sharpe=-0.036, Edge=-0.776, z=-8.82 → NO BEATS −0.045 / −0.785 / z=−8.33 → NO BEATS (micro-drift)
Best model / VERDICT Mamba / INCONCLUSIVE identique
  • 12 valeurs 3+ décimales communes ; 5 disparues (micro-drift TFT-Lite uniquement, données Yahoo re-téléchargées), aucune citée en prose (vérifié par intersection outputs∩prose) — 0 remplacement nécessaire.
  • Le pipeline walk-forward CPU avec fenêtre pinnée est reproductible : les deux tiers des lignes de verdict sont bit-identiques, le tiers restant (TFT-Lite, architecture la plus sensible) dérive de quelques millièmes sans changer aucun verdict.

Périmètre

1 fichier, projects/Mamba-Crypto-Ranking/research.ipynb.

SOTA

SOTA-OK : vrai PyTorch CPU (selective SSM pur PyTorch de l'auteur), vraies données Yahoo re-téléchargées, kernel documenté, sorties réelles, aucun workaround.

See #16795 (contribution partielle — volet QC ; 1 FIX_CANDIDATE restant : TFT-Crypto-Ranking)

🤖 Generated with Claude Code

…plicites + re-exec quasi-bit-identique

Trio determinisme (CUBLAS avant import torch, cudnn deterministic,
use_deterministic_algorithms warn_only) en cellule 1 au site du seed
global. Re-execution papermill 11/11, 0 erreur : lignes verdict Mamba/
DLinear/BH bit-identiques, micro-drift TFT-Lite seul (-0.036->-0.045),
verdict INCONCLUSIVE inchange, 0 ancrage prose stale.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ No prose/output mismatch detected in the notebooks this PR changed.

Scope = notebooks CHANGED in this PR, not the whole corpus. Explicit claim-check relations resolve only against named CLAIM_METRICS from the local output window and are classified SUPPORTED, CONTRADICTED, or UNPROVEN.
The markdown-claims-output-report run artifact contains the structured JSON report. See python scripts/check_markdown_claims_output.py --help for re-running locally.
Detector rationale: c.290 / c.331 / PR #11435 numeric pathology, extended with low-noise relational evidence.

@github-actions

Copy link
Copy Markdown
Contributor

Notebook outputs-required (H.4 schema): PASS (every code cell carries an outputs: list)

@github-actions

Copy link
Copy Markdown
Contributor

Notebook PR Validation: PASS

  • Notebooks checked: 1
  • Code cells validated: 11
  • Result: All passed

Checks: H.1 (no errors), H.3 (execution_count), C.1 (no banned patterns)
Non-Python kernels (.NET/Lean): C.1 + errors only (execution_count advisory)
QuantConnect notebooks: C.1 + errors only (require QC Cloud for execution)

@github-actions

Copy link
Copy Markdown
Contributor

Golden-Set Execution (H.7 P3)

✅ 8/8 notebooks passed (certified reproducible)

Notebook Status Time
2.1-Workflow-ML.ipynb ✅ SUCCESS 2.8s
2.2-Descente-de-gradient.ipynb ✅ SUCCESS 9.6s
2.3-Regression-lineaire-logistique.ipynb ✅ SUCCESS 5.5s
2.4-Arbres-Forets-Ensembles.ipynb ✅ SUCCESS 3.5s
Search-01-StateSpace.ipynb ✅ SUCCESS 2.8s
SL-1-LogicalLearning.ipynb ✅ SUCCESS 1.6s
rl_4_multi_armed_bandits.ipynb ✅ SUCCESS 14.7s
GameTheory-04c-NashExistence-Python.ipynb ✅ SUCCESS 2.3s

Pinned lockfile: scripts/notebook_tools/golden_set.lock.txt (H.7 P3, axe A #4208)

@github-actions

github-actions Bot commented Sep 19, 2026 •

Copy link
Copy Markdown
Contributor

Path-collision (organ #13359/#13615)

Cette PR #16823 (fix(qc,#16795): research Mamba-Crypto-Ranking — déterminisme explicite + re-exécution quasi-bit-identique) touche au moins un chemin de fichier aussi modifie par d'autres PRs ouvertes. Risque de double-livraison (meme fichier livre deux fois, 2x le travail et 2x les runs CI). Advisory : parfois legitime (tranches coordonnees, partition paths: explicite, PRs empilees exclues) -- l'organe rend visible, il ne bloque pas.

@jsboige

jsboige commented Sep 19, 2026

Copy link
Copy Markdown
Owner Author

[ADJOINT PREFLIGHT]
schema: 1
lane: myia-po-2027:CoursIA
pr: 16823
head: bf853a0
complete: true
body: read
comments-reviewed: 5
reviews-reviewed: 0
threads-reviewed: 0
threads-unresolved: 0
surfaces-sha256: ae2eca11cac8b57fc4f76a03502f5cfdbe05aa5a9f48c187e7f0378ced69e1d2
diff-files: 1
diff-additions: 130
diff-deletions: 117
checks: latest-wins-green
b0: clear
scope: pass
domain: pass
verdict: READY
[/ADJOINT PREFLIGHT]

Dossier de prevalidation tierce (gate #16907, Phase 4) — premier dossier sur cette PR.

Verifications firsthand au head exact bf853a0

  • B.0 : check_unaddressed_nits.py 16823 rc=0 ; 5 commentaires lus, 0 review, 0 thread inline.
  • Checks latest-wins : 0 check non vert.
  • Scope : 1 fichier, Mamba-Crypto-Ranking/research.ipynb +130/−117 — conforme au titre (determinisme explicite, tranche 12 Metriques GPU non reproductibles : 43 notebooks posent une graine sans reglage de determinisme #16795).
  • Domaine (QC research) : le fix est chirurgical (flags cudnn.deterministic + use_deterministic_algorithms en cellule 1, seeds existants inchanges) ; re-execution papermill 11/11 cellules kernel coursia-ml-training, 0 erreur ; lignes de verdict quasi-bit-identiques entre avant et apres (VERDICT INCONCLUSIVE preserve — aucune metrique amelioree par le fix, preuve que le determinisme ne change pas le resultat). CPU-only pinne, execution locale legitime (pas de quantbook).

Disposition : READY pour lecture finale ai-01. Aucun merge, APPROVED ou CHANGES_REQUESTED effectue ici.

@clusterManager-Myia clusterManager-Myia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VERDICT: LGTM — claims de reproductibilité vérifiés chiffre à chiffre contre les outputs committés au head bf853a0656.

[Hermes] — Review firsthand du delta (1 fichier, +130/−117), comparaison base↔head cellule par cellule.

Vérifications :

  1. Fix déterminisme présent et conforme au body : cellule 1 ajoute CUBLAS_WORKSPACE_CONFIG=:4096:8 avant import torch + cudnn.deterministic=True / benchmark=False / use_deterministic_algorithms(True, warn_only=True) — seeds existants inchangés (vérifié : seul le bloc déterminisme est ajouté à la source).
  2. Tableau « Reproductibilité » du body = outputs réels : Benchmark BH 0.74 ✓, Mamba Sharpe=0.000, Edge=-0.740, z=0.00 → INCONCLUSIVE bit-identique ✓, DLinear -0.011/-0.751/-2.64 → NO BEATS bit-identique ✓, TFT-Lite micro-drift -0.045/-0.785/std=0.094/z=-8.33 → NO BEATS exactement comme annoncé ✓, Best model Mamba ✓. Les 4 autres cellules outputs changées sont cohérentes : cellule 15 ne dérive que sur 2 lignes TFT-Lite (folds), cellule 10 = un retour ligne près, cellule 19 identique.
  3. Micro-drift contenu : il touche uniquement TFT-Lite (2 seeds sur 4, écart ~0.01-0.02), aucun verdict ne bascule — le body n'élude rien.

Nit hors périmètre (base-inherited, pas de cette PR) : la cellule gradient-verification imprime std: nan (target > 0.01) puis OK: Selective scan produces non-trivial output (std=nan) — un « OK » sur std=nan est un faux positif du check interne, identique en base. À traiter dans une tranche ultérieure #16795 si pertinent, pas bloquant ici.

Identité : COMMENT (opener jsboige, cap self-review #3219).

[Hermes hermes-pr-review, cycle :22 19/09, host c92df397a786]

@jsboige

jsboige commented Sep 21, 2026

Copy link
Copy Markdown
Owner Author

[ADJOINT PREFLIGHT]
schema: 1
lane: myia-po-2025:CoursIA-2
pr: 16823
head: bf853a0
complete: true
body: read
comments-reviewed: 6
reviews-reviewed: 1
threads-reviewed: 0
threads-unresolved: 0
surfaces-sha256: 530afe62d7c51755ab86f65f05bc48d8dffca5c2d9b92e6e2589bd1cadc3ea9e
diff-files: 1
diff-additions: 130
diff-deletions: 117
checks: latest-wins-green
b0: clear
scope: pass
domain: pass
verdict: READY
[/ADJOINT PREFLIGHT]

@jsboige
jsboige merged commit c2d9335 into main Sep 21, 2026
78 of 79 checks passed
myia-ai-01 pushed a commit that referenced this pull request Sep 23, 2026
…1/32, research_rl_grpo) (#17482)

* fix(qc,#16795): determinisme GPU strict — residu non couvert (QC-Py-31/32, research_rl_grpo)

Three notebooks from the closed QC determinism series whose re-executed states
were NOT covered on main (arbitrage c.38 volet QC, DM po2026-arb-16795-qc-volet) :
main already carries the same fixes for QC-Py-22/23/24/33/34 + 6 research via
#16803/#16806/#16807/#16811/#16812/#16815/#16816/#16818/#16822/#16823/#16824.
Cherry-picked states from the retained branches feature/16795-qcdet-pr{A,B,C}.

C.2: execution_count+outputs coherents (17/17, 15/15, 7/7), 0 error, 0
NotImplementedError; machine attestee dans les sorties (PyTorch 2.6.0+cu124,
device cuda, NVIDIA RTX 3080 Ti; GRPO 4 seeds pour research_rl_grpo).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* ci: force fresh pull_request event (body Diagnostic derive kernel ajoutee)

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
jsboige added a commit that referenced this pull request Sep 23, 2026
…1/32, research_rl_grpo) (#17482)

* fix(qc,#16795): determinisme GPU strict — residu non couvert (QC-Py-31/32, research_rl_grpo)

Three notebooks from the closed QC determinism series whose re-executed states
were NOT covered on main (arbitrage c.38 volet QC, DM po2026-arb-16795-qc-volet) :
main already carries the same fixes for QC-Py-22/23/24/33/34 + 6 research via
#16803/#16806/#16807/#16811/#16812/#16815/#16816/#16818/#16822/#16823/#16824.
Cherry-picked states from the retained branches feature/16795-qcdet-pr{A,B,C}.

C.2: execution_count+outputs coherents (17/17, 15/15, 7/7), 0 error, 0
NotImplementedError; machine attestee dans les sorties (PyTorch 2.6.0+cu124,
device cuda, NVIDIA RTX 3080 Ti; GRPO 4 seeds pour research_rl_grpo).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* ci: force fresh pull_request event (body Diagnostic derive kernel ajoutee)

---------

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-overlap Advisory: another open PR touches the same files (organ #13615)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants