Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Status on cloudpickle non-determinism

Aperta
#453 4 commenti 2 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Inizia esaminando l’issue #385 e la PR #428, quindi riproduci le differenze di ordinamento segnalate con pickletools.dis su una funzione minimale. L’issue non fornisce né un caso di test breve né un file sorgente; il lavoro è completato quando è stata stabilita la posizione ufficiale del progetto sui pickle deterministici ed è stata registrata una risoluzione chiara per il comportamento di cloudpickle 2.0.0.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

pickle issue

Hello,

@ogrisel mentioned in this comment (https://github.com/cloudpipe/cloudpickle/issues/385#issuecomment-661103789):

Anyway, having deterministic pickles is probably out of scope for cloudpickle so I would be in favor of closing this issue.

However, @ogrisel also pushed a PR (#428) which was released as part of cloudpickle 2.0.0 that tried to address non determinism owing to dictionary ordering.

I wanted to confirm what is the official status of the project regarding non determinism because I am still seeing non deterministic pickles in cloudpickle 2.0.0

Here is the pickletools.dis outputs of a function:

...
 2539: (                MARK  
 2540: \x8c                 SHORT_BINUNICODE 'correlation_matrix'                                                                           
 2560: \x94                 MEMOIZE    (as 115)
 2561: \x8c                 SHORT_BINUNICODE 'drifts_annual'                                                                                
 2576: \x94                 MEMOIZE    (as 116)
 2577: \x8c                 SHORT_BINUNICODE 'initial_prices'                                                                               
 2593: \x94                 MEMOIZE    (as 117)                                                                                             
 2594: \x8c                 SHORT_BINUNICODE 'volatilities_annual'                                                                          
 2615: \x94                 MEMOIZE    (as 118)                                                                                             
 2616: \x91                 FROZENSET  (MARK at 2539)
 2617: \x94             MEMOIZE    (as 119)  
...

pickle of a function on second attempt:

...
 2539: (                MARK  
 2540: \x8c                 SHORT_BINUNICODE 'volatilities_annual'                                                                          
 2561: \x94                 MEMOIZE    (as 115)
 2562: \x8c                 SHORT_BINUNICODE 'initial_prices'                                                                               
 2578: \x94                 MEMOIZE    (as 116)
 2579: \x8c                 SHORT_BINUNICODE 'drifts_annual'
 2594: \x94                 MEMOIZE    (as 117)                                                                                             
 2595: \x8c                 SHORT_BINUNICODE 'correlation_matrix'
 2615: \x94                 MEMOIZE    (as 118)                                                                                             
 2616: \x91                 FROZENSET  (MARK at 2539)
 2617: \x94             MEMOIZE    (as 119)
...       

As you can see, the entries are all the same, but shuffled around.

This function is part of a large project, so unfortunately I can't produce a short test case right now.

Notice that kubeflow pipelines implement caching by making sure that pickle of the function hasn't changed. (there is an option to not use pickle as well, but it has its own problems). Having a non deterministic cloudpickle invalidates the cache every time making that feature useless.

Thanks.

Lingua principale
Python
Stelle
1.9k
Fork
197
Merge medio
1g 10h
PR unite (30g)
1

Preparare l'ambiente

Non abbiamo ancora controllato i file di configurazione di questo progetto. Parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cloudpipe/cloudpickle

Tutte le issue di cloudpipe/cloudpickle

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.