wandb 0.20.1rc20250604__py3-none-any.whl → 0.21.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. wandb/__init__.py +3 -6
  2. wandb/__init__.pyi +24 -23
  3. wandb/analytics/sentry.py +2 -2
  4. wandb/apis/importers/internals/internal.py +0 -3
  5. wandb/apis/internal.py +3 -0
  6. wandb/apis/paginator.py +17 -4
  7. wandb/apis/public/api.py +85 -4
  8. wandb/apis/public/artifacts.py +10 -8
  9. wandb/apis/public/files.py +5 -5
  10. wandb/apis/public/projects.py +44 -3
  11. wandb/apis/public/registries/{utils.py → _utils.py} +12 -12
  12. wandb/apis/public/registries/registries_search.py +2 -2
  13. wandb/apis/public/registries/registry.py +19 -18
  14. wandb/apis/public/reports.py +64 -8
  15. wandb/apis/public/runs.py +16 -23
  16. wandb/automations/__init__.py +10 -10
  17. wandb/automations/_filters/run_metrics.py +0 -2
  18. wandb/automations/_utils.py +0 -2
  19. wandb/automations/actions.py +0 -2
  20. wandb/automations/automations.py +0 -2
  21. wandb/automations/events.py +0 -2
  22. wandb/bin/gpu_stats +0 -0
  23. wandb/cli/beta.py +1 -7
  24. wandb/cli/cli.py +0 -30
  25. wandb/env.py +0 -6
  26. wandb/integration/catboost/catboost.py +6 -2
  27. wandb/integration/kfp/kfp_patch.py +3 -1
  28. wandb/integration/sb3/sb3.py +3 -3
  29. wandb/integration/ultralytics/callback.py +6 -2
  30. wandb/plot/__init__.py +2 -0
  31. wandb/plot/bar.py +30 -29
  32. wandb/plot/confusion_matrix.py +75 -71
  33. wandb/plot/histogram.py +26 -25
  34. wandb/plot/line.py +33 -32
  35. wandb/plot/line_series.py +100 -103
  36. wandb/plot/pr_curve.py +33 -32
  37. wandb/plot/roc_curve.py +38 -38
  38. wandb/plot/scatter.py +27 -27
  39. wandb/proto/v3/wandb_internal_pb2.py +366 -385
  40. wandb/proto/v3/wandb_settings_pb2.py +2 -2
  41. wandb/proto/v3/wandb_telemetry_pb2.py +10 -10
  42. wandb/proto/v4/wandb_internal_pb2.py +352 -356
  43. wandb/proto/v4/wandb_settings_pb2.py +2 -2
  44. wandb/proto/v4/wandb_telemetry_pb2.py +10 -10
  45. wandb/proto/v5/wandb_internal_pb2.py +352 -356
  46. wandb/proto/v5/wandb_settings_pb2.py +2 -2
  47. wandb/proto/v5/wandb_telemetry_pb2.py +10 -10
  48. wandb/proto/v6/wandb_internal_pb2.py +352 -356
  49. wandb/proto/v6/wandb_settings_pb2.py +2 -2
  50. wandb/proto/v6/wandb_telemetry_pb2.py +10 -10
  51. wandb/sdk/artifacts/_generated/__init__.py +12 -1
  52. wandb/sdk/artifacts/_generated/input_types.py +20 -2
  53. wandb/sdk/artifacts/_generated/link_artifact.py +21 -0
  54. wandb/sdk/artifacts/_generated/operations.py +9 -0
  55. wandb/sdk/artifacts/_validators.py +40 -2
  56. wandb/sdk/artifacts/artifact.py +163 -21
  57. wandb/sdk/artifacts/storage_handlers/s3_handler.py +42 -1
  58. wandb/sdk/backend/backend.py +1 -1
  59. wandb/sdk/data_types/base_types/media.py +9 -7
  60. wandb/sdk/data_types/base_types/wb_value.py +6 -6
  61. wandb/sdk/data_types/saved_model.py +3 -3
  62. wandb/sdk/data_types/table.py +41 -41
  63. wandb/sdk/data_types/trace_tree.py +12 -12
  64. wandb/sdk/interface/interface.py +8 -19
  65. wandb/sdk/interface/interface_shared.py +7 -16
  66. wandb/sdk/internal/datastore.py +18 -18
  67. wandb/sdk/internal/handler.py +4 -74
  68. wandb/sdk/internal/internal_api.py +54 -0
  69. wandb/sdk/internal/sender.py +23 -3
  70. wandb/sdk/internal/sender_config.py +9 -0
  71. wandb/sdk/launch/_project_spec.py +3 -3
  72. wandb/sdk/launch/agent/agent.py +3 -3
  73. wandb/sdk/launch/agent/job_status_tracker.py +3 -1
  74. wandb/sdk/launch/utils.py +3 -3
  75. wandb/sdk/lib/console_capture.py +66 -19
  76. wandb/sdk/lib/printer.py +6 -7
  77. wandb/sdk/lib/progress.py +1 -3
  78. wandb/sdk/lib/service/ipc_support.py +13 -0
  79. wandb/sdk/lib/{service_connection.py → service/service_connection.py} +20 -56
  80. wandb/sdk/lib/service/service_port_file.py +105 -0
  81. wandb/sdk/lib/service/service_process.py +111 -0
  82. wandb/sdk/lib/service/service_token.py +164 -0
  83. wandb/sdk/lib/sock_client.py +8 -12
  84. wandb/sdk/wandb_init.py +1 -5
  85. wandb/sdk/wandb_require.py +9 -21
  86. wandb/sdk/wandb_run.py +23 -137
  87. wandb/sdk/wandb_settings.py +233 -80
  88. wandb/sdk/wandb_setup.py +2 -13
  89. {wandb-0.20.1rc20250604.dist-info → wandb-0.21.0.dist-info}/METADATA +1 -3
  90. {wandb-0.20.1rc20250604.dist-info → wandb-0.21.0.dist-info}/RECORD +93 -119
  91. wandb/sdk/internal/flow_control.py +0 -263
  92. wandb/sdk/internal/internal.py +0 -401
  93. wandb/sdk/internal/internal_util.py +0 -97
  94. wandb/sdk/internal/system/__init__.py +0 -0
  95. wandb/sdk/internal/system/assets/__init__.py +0 -25
  96. wandb/sdk/internal/system/assets/aggregators.py +0 -31
  97. wandb/sdk/internal/system/assets/asset_registry.py +0 -20
  98. wandb/sdk/internal/system/assets/cpu.py +0 -163
  99. wandb/sdk/internal/system/assets/disk.py +0 -210
  100. wandb/sdk/internal/system/assets/gpu.py +0 -416
  101. wandb/sdk/internal/system/assets/gpu_amd.py +0 -233
  102. wandb/sdk/internal/system/assets/interfaces.py +0 -205
  103. wandb/sdk/internal/system/assets/ipu.py +0 -177
  104. wandb/sdk/internal/system/assets/memory.py +0 -166
  105. wandb/sdk/internal/system/assets/network.py +0 -125
  106. wandb/sdk/internal/system/assets/open_metrics.py +0 -293
  107. wandb/sdk/internal/system/assets/tpu.py +0 -154
  108. wandb/sdk/internal/system/assets/trainium.py +0 -393
  109. wandb/sdk/internal/system/env_probe_helpers.py +0 -13
  110. wandb/sdk/internal/system/system_info.py +0 -248
  111. wandb/sdk/internal/system/system_monitor.py +0 -224
  112. wandb/sdk/internal/writer.py +0 -204
  113. wandb/sdk/lib/service_token.py +0 -93
  114. wandb/sdk/service/__init__.py +0 -0
  115. wandb/sdk/service/_startup_debug.py +0 -22
  116. wandb/sdk/service/port_file.py +0 -53
  117. wandb/sdk/service/server.py +0 -107
  118. wandb/sdk/service/server_sock.py +0 -286
  119. wandb/sdk/service/service.py +0 -252
  120. wandb/sdk/service/streams.py +0 -425
  121. wandb/sdk/wandb_metadata.py +0 -623
  122. {wandb-0.20.1rc20250604.dist-info → wandb-0.21.0.dist-info}/WHEEL +0 -0
  123. {wandb-0.20.1rc20250604.dist-info → wandb-0.21.0.dist-info}/entry_points.txt +0 -0
  124. {wandb-0.20.1rc20250604.dist-info → wandb-0.21.0.dist-info}/licenses/LICENSE +0 -0
@@ -299,7 +299,10 @@ class Settings(BaseModel, validate_assignment=True):
299
299
  """Root directory of the git repository."""
300
300
 
301
301
  heartbeat_seconds: int = 30
302
- """Interval in seconds between heartbeat signals sent to the W&B servers."""
302
+ """Interval in seconds between heartbeat signals sent to the W&B servers.
303
+
304
+ <!-- lazydoc-ignore-class-attributes -->
305
+ """
303
306
 
304
307
  host: Optional[str] = None
305
308
  """Hostname of the machine running the script."""
@@ -310,7 +313,6 @@ class Settings(BaseModel, validate_assignment=True):
310
313
  https_proxy: Optional[str] = None
311
314
  """Custom proxy servers for https requests to W&B."""
312
315
 
313
- # Path to file containing an identity token (JWT) for authentication.
314
316
  identity_token_file: Optional[str] = None
315
317
  """Path to file containing an identity token (JWT) for authentication."""
316
318
 
@@ -333,7 +335,10 @@ class Settings(BaseModel, validate_assignment=True):
333
335
  """Whether to disable automatic labeling features."""
334
336
 
335
337
  launch: bool = False
336
- """Flag to indicate if the run is being launched through W&B Launch."""
338
+ """Flag to indicate if the run is being launched through W&B Launch.
339
+
340
+ <!-- lazydoc-ignore-class-attributes -->
341
+ """
337
342
 
338
343
  launch_config_path: Optional[str] = None
339
344
  """Path to the launch configuration file."""
@@ -341,7 +346,7 @@ class Settings(BaseModel, validate_assignment=True):
341
346
  login_timeout: Optional[float] = None
342
347
  """Time in seconds to wait for login operations before timing out."""
343
348
 
344
- mode: Literal["online", "offline", "dryrun", "disabled", "run", "shared"] = Field(
349
+ mode: Literal["online", "offline", "shared", "disabled", "dryrun", "run"] = Field(
345
350
  default="online",
346
351
  validate_default=True,
347
352
  )
@@ -403,19 +408,15 @@ class Settings(BaseModel, validate_assignment=True):
403
408
  resume: Optional[Literal["allow", "must", "never", "auto"]] = None
404
409
  """Specifies the resume behavior for the run.
405
410
 
406
- The available options are:
407
-
408
- "must": Resumes from an existing run with the same ID. If no such run exists,
409
- it will result in failure.
410
-
411
- "allow": Attempts to resume from an existing run with the same ID. If none is
412
- found, a new run will be created.
413
-
414
- "never": Always starts a new run. If a run with the same ID already exists,
415
- it will result in failure.
416
-
417
- "auto": Automatically resumes from the most recent failed run on the same
418
- machine.
411
+ Options:
412
+ - "must": Resumes from an existing run with the same ID. If no such run exists,
413
+ it will result in failure.
414
+ - "allow": Attempts to resume from an existing run with the same ID. If none is
415
+ found, a new run will be created.
416
+ - "never": Always starts a new run. If a run with the same ID already exists,
417
+ it will result in failure.
418
+ - "auto": Automatically resumes from the most recent failed run on the same
419
+ machine.
419
420
  """
420
421
 
421
422
  resume_from: Optional[RunMoment] = None
@@ -429,6 +430,7 @@ class Settings(BaseModel, validate_assignment=True):
429
430
  """Indication from the server about the state of the run.
430
431
 
431
432
  This is different from resume, a user provided flag.
433
+ <!-- lazydoc-ignore-class-attributes -->
432
434
  """
433
435
 
434
436
  root_dir: str = Field(default_factory=lambda: os.path.abspath(os.getcwd()))
@@ -468,10 +470,16 @@ class Settings(BaseModel, validate_assignment=True):
468
470
  """Path to the system-wide settings file."""
469
471
 
470
472
  show_colors: Optional[bool] = None
471
- """Whether to use colored output in the console."""
473
+ """Whether to use colored output in the console.
474
+
475
+ <!-- lazydoc-ignore-class-attributes -->
476
+ """
472
477
 
473
478
  show_emoji: Optional[bool] = None
474
- """Whether to show emoji in the console output."""
479
+ """Whether to show emoji in the console output.
480
+
481
+ <!-- lazydoc-ignore-class-attributes -->
482
+ """
475
483
 
476
484
  show_errors: bool = True
477
485
  """Whether to display error messages."""
@@ -486,7 +494,11 @@ class Settings(BaseModel, validate_assignment=True):
486
494
  """Flag to suppress all output."""
487
495
 
488
496
  start_method: Optional[str] = None
489
- """Method to use for starting subprocesses."""
497
+ """Method to use for starting subprocesses.
498
+
499
+ This is deprecated and will be removed in a future release.
500
+ <!-- lazydoc-ignore-class-attributes -->
501
+ """
490
502
 
491
503
  strict: Optional[bool] = None
492
504
  """Whether to enable strict mode for validation and error checking."""
@@ -494,8 +506,11 @@ class Settings(BaseModel, validate_assignment=True):
494
506
  summary_timeout: int = 60
495
507
  """Time in seconds to wait for summary operations before timing out."""
496
508
 
497
- summary_warnings: int = 5 # TODO: kill this with fire
498
- """Maximum number of summary warnings to display."""
509
+ summary_warnings: int = 5
510
+ """Maximum number of summary warnings to display.
511
+
512
+ <!-- lazydoc-ignore-class-attributes -->
513
+ """
499
514
 
500
515
  sweep_id: Optional[str] = None
501
516
  """Identifier of the sweep this run belongs to."""
@@ -523,28 +538,34 @@ class Settings(BaseModel, validate_assignment=True):
523
538
  # a part of the public API as they may change or be removed in future versions.
524
539
 
525
540
  x_cli_only_mode: bool = False
526
- """Flag to indicate that the SDK is running in CLI-only mode."""
541
+ """Flag to indicate that the SDK is running in CLI-only mode.
542
+
543
+ <!-- lazydoc-ignore-class-attributes -->
544
+ """
527
545
 
528
546
  x_disable_meta: bool = False
529
547
  """Flag to disable the collection of system metadata."""
530
548
 
531
- x_disable_setproctitle: bool = False
532
- """Flag to disable using setproctitle for the internal process in the legacy service.
533
-
534
- This is deprecated and will be removed in future versions.
535
- """
536
-
537
549
  x_disable_stats: bool = False
538
550
  """Flag to disable the collection of system metrics."""
539
551
 
540
552
  x_disable_viewer: bool = False
541
- """Flag to disable the early viewer query."""
553
+ """Flag to disable the early viewer query.
554
+
555
+ <!-- lazydoc-ignore-class-attributes -->
556
+ """
542
557
 
543
558
  x_disable_machine_info: bool = False
544
- """Flag to disable automatic machine info collection."""
559
+ """Flag to disable automatic machine info collection.
560
+
561
+ <!-- lazydoc-ignore-class-attributes -->
562
+ """
545
563
 
546
564
  x_executable: Optional[str] = None
547
- """Path to the Python executable."""
565
+ """Path to the Python executable.
566
+
567
+ <!-- lazydoc-ignore-class-attributes -->
568
+ """
548
569
 
549
570
  x_extra_http_headers: Optional[Dict[str, str]] = None
550
571
  """Additional headers to add to all outgoing HTTP requests."""
@@ -555,82 +576,142 @@ class Settings(BaseModel, validate_assignment=True):
555
576
  Its purpose is to prevent HTTP requests from failing due to
556
577
  containing too much data. This number is approximate:
557
578
  requests will be slightly larger.
579
+ <!-- lazydoc-ignore-class-attributes -->
558
580
  """
559
581
 
560
582
  x_file_stream_max_line_bytes: Optional[int] = None
561
- """Maximum line length for filestream JSONL files."""
583
+ """Maximum line length for filestream JSONL files.
584
+
585
+ <!-- lazydoc-ignore-class-attributes -->
586
+ """
562
587
 
563
588
  x_file_stream_transmit_interval: Optional[float] = None
564
- """Interval in seconds between filestream transmissions."""
589
+ """Interval in seconds between filestream transmissions.
590
+
591
+ <!-- lazydoc-ignore-class-attributes -->
592
+ """
565
593
 
566
594
  # Filestream retry client configuration.
567
595
 
568
596
  x_file_stream_retry_max: Optional[int] = None
569
- """Max number of retries for filestream operations."""
597
+ """Max number of retries for filestream operations.
598
+
599
+ <!-- lazydoc-ignore-class-attributes -->
600
+ """
570
601
 
571
602
  x_file_stream_retry_wait_min_seconds: Optional[float] = None
572
- """Minimum wait time between retries for filestream operations."""
603
+ """Minimum wait time between retries for filestream operations.
604
+
605
+ <!-- lazydoc-ignore-class-attributes -->
606
+ """
573
607
 
574
608
  x_file_stream_retry_wait_max_seconds: Optional[float] = None
575
- """Maximum wait time between retries for filestream operations."""
609
+ """Maximum wait time between retries for filestream operations.
610
+
611
+ <!-- lazydoc-ignore-class-attributes -->
612
+ """
576
613
 
577
614
  x_file_stream_timeout_seconds: Optional[float] = None
578
- """Timeout in seconds for individual filestream HTTP requests."""
615
+ """Timeout in seconds for individual filestream HTTP requests.
616
+
617
+ <!-- lazydoc-ignore-class-attributes -->
618
+ """
579
619
 
580
620
  # file transfer retry client configuration
581
621
 
582
622
  x_file_transfer_retry_max: Optional[int] = None
583
- """Max number of retries for file transfer operations."""
623
+ """Max number of retries for file transfer operations.
624
+
625
+ <!-- lazydoc-ignore-class-attributes -->
626
+ """
584
627
 
585
628
  x_file_transfer_retry_wait_min_seconds: Optional[float] = None
586
- """Minimum wait time between retries for file transfer operations."""
629
+ """Minimum wait time between retries for file transfer operations.
630
+
631
+ <!-- lazydoc-ignore-class-attributes -->
632
+ """
587
633
 
588
634
  x_file_transfer_retry_wait_max_seconds: Optional[float] = None
589
- """Maximum wait time between retries for file transfer operations."""
635
+ """Maximum wait time between retries for file transfer operations.
636
+
637
+ <!-- lazydoc-ignore-class-attributes -->
638
+ """
590
639
 
591
640
  x_file_transfer_timeout_seconds: Optional[float] = None
592
- """Timeout in seconds for individual file transfer HTTP requests."""
641
+ """Timeout in seconds for individual file transfer HTTP requests.
642
+
643
+ <!-- lazydoc-ignore-class-attributes -->
644
+ """
593
645
 
594
646
  x_files_dir: Optional[str] = None
595
- """Override setting for the computed files_dir.."""
647
+ """Override setting for the computed files_dir.
648
+
649
+ <!-- lazydoc-ignore-class-attributes -->
650
+ """
596
651
 
597
652
  x_flow_control_custom: Optional[bool] = None
598
653
  """Flag indicating custom flow control for filestream.
599
654
 
600
655
  TODO: Not implemented in wandb-core.
656
+ <!-- lazydoc-ignore-class-attributes -->
601
657
  """
602
658
 
603
659
  x_flow_control_disabled: Optional[bool] = None
604
660
  """Flag indicating flow control is disabled for filestream.
605
661
 
606
662
  TODO: Not implemented in wandb-core.
663
+ <!-- lazydoc-ignore-class-attributes -->
607
664
  """
608
665
 
609
666
  # graphql retry client configuration
610
667
 
611
668
  x_graphql_retry_max: Optional[int] = None
612
- """Max number of retries for GraphQL operations."""
669
+ """Max number of retries for GraphQL operations.
670
+
671
+ <!-- lazydoc-ignore-class-attributes -->
672
+ """
613
673
 
614
674
  x_graphql_retry_wait_min_seconds: Optional[float] = None
615
- """Minimum wait time between retries for GraphQL operations."""
675
+ """Minimum wait time between retries for GraphQL operations.
676
+
677
+ <!-- lazydoc-ignore-class-attributes -->
678
+ """
616
679
 
617
680
  x_graphql_retry_wait_max_seconds: Optional[float] = None
618
- """Maximum wait time between retries for GraphQL operations."""
681
+ """Maximum wait time between retries for GraphQL operations.
682
+
683
+ <!-- lazydoc-ignore-class-attributes -->
684
+ """
619
685
 
620
686
  x_graphql_timeout_seconds: Optional[float] = None
621
- """Timeout in seconds for individual GraphQL requests."""
687
+ """Timeout in seconds for individual GraphQL requests.
688
+
689
+ <!-- lazydoc-ignore-class-attributes -->
690
+ """
622
691
 
623
692
  x_internal_check_process: float = 8.0
624
- """Interval for internal process health checks in seconds."""
693
+ """Interval for internal process health checks in seconds.
694
+
695
+ <!-- lazydoc-ignore-class-attributes -->
696
+ """
625
697
 
626
698
  x_jupyter_name: Optional[str] = None
627
- """Name of the Jupyter notebook."""
699
+ """Name of the Jupyter notebook.
700
+
701
+ <!-- lazydoc-ignore-class-attributes -->
702
+ """
628
703
 
629
704
  x_jupyter_path: Optional[str] = None
630
- """Path to the Jupyter notebook."""
705
+ """Path to the Jupyter notebook.
706
+
707
+ <!-- lazydoc-ignore-class-attributes -->
708
+ """
631
709
 
632
710
  x_jupyter_root: Optional[str] = None
633
- """Root directory of the Jupyter notebook."""
711
+ """Root directory of the Jupyter notebook.
712
+
713
+ <!-- lazydoc-ignore-class-attributes -->
714
+ """
634
715
 
635
716
  x_label: Optional[str] = None
636
717
  """Label to assign to system metrics and console logs collected for the run.
@@ -640,18 +721,28 @@ class Settings(BaseModel, validate_assignment=True):
640
721
  """
641
722
 
642
723
  x_live_policy_rate_limit: Optional[int] = None
643
- """Rate limit for live policy updates in seconds."""
724
+ """Rate limit for live policy updates in seconds.
725
+
726
+ <!-- lazydoc-ignore-class-attributes -->
727
+ """
644
728
 
645
729
  x_live_policy_wait_time: Optional[int] = None
646
- """Wait time between live policy updates in seconds."""
730
+ """Wait time between live policy updates in seconds.
731
+
732
+ <!-- lazydoc-ignore-class-attributes -->
733
+ """
647
734
 
648
735
  x_log_level: int = logging.INFO
649
- """Logging level for internal operations."""
736
+ """Logging level for internal operations.
737
+
738
+ <!-- lazydoc-ignore-class-attributes -->
739
+ """
650
740
 
651
741
  x_network_buffer: Optional[int] = None
652
742
  """Size of the network buffer used in flow control.
653
743
 
654
744
  TODO: Not implemented in wandb-core.
745
+ <!-- lazydoc-ignore-class-attributes -->
655
746
  """
656
747
 
657
748
  x_primary: bool = Field(
@@ -667,15 +758,16 @@ class Settings(BaseModel, validate_assignment=True):
667
758
  x_proxies: Optional[Dict[str, str]] = None
668
759
  """Custom proxy servers for requests to W&B.
669
760
 
670
- This is deprecated and will be removed in future versions.
761
+ This is deprecated and will be removed in a future release.
671
762
  Please use `http_proxy` and `https_proxy` instead.
763
+ <!-- lazydoc-ignore-class-attributes -->
672
764
  """
673
765
 
674
766
  x_runqueue_item_id: Optional[str] = None
675
- """ID of the Launch run queue item being processed."""
767
+ """ID of the Launch run queue item being processed.
676
768
 
677
- x_require_legacy_service: bool = False
678
- """Force the use of legacy wandb service."""
769
+ <!-- lazydoc-ignore-class-attributes -->
770
+ """
679
771
 
680
772
  x_save_requirements: bool = True
681
773
  """Flag to save the requirements file."""
@@ -686,14 +778,18 @@ class Settings(BaseModel, validate_assignment=True):
686
778
  This does not disable user-provided summary updates.
687
779
  """
688
780
 
689
- x_server_side_expand_glob_metrics: bool = False
781
+ x_server_side_expand_glob_metrics: bool = True
690
782
  """Flag to delegate glob matching of metrics in define_metric to the server.
691
783
 
692
784
  If the server does not support this, the client will perform the glob matching.
785
+ <!-- lazydoc-ignore-class-attributes -->
693
786
  """
694
787
 
695
788
  x_service_transport: Optional[str] = None
696
- """Transport method for communication with the wandb service."""
789
+ """Transport method for communication with the wandb service.
790
+
791
+ <!-- lazydoc-ignore-class-attributes -->
792
+ """
697
793
 
698
794
  x_service_wait: float = 30.0
699
795
  """Time in seconds to wait for the wandb-core internal service to start."""
@@ -705,13 +801,20 @@ class Settings(BaseModel, validate_assignment=True):
705
801
  data written to disk.
706
802
 
707
803
  Should be used with caution, as it removes the gurantees about
708
- recoverability."""
804
+ recoverability.
805
+ """
709
806
 
710
807
  x_start_time: Optional[float] = None
711
- """The start time of the run in seconds since the Unix epoch."""
808
+ """The start time of the run in seconds since the Unix epoch.
809
+
810
+ <!-- lazydoc-ignore-class-attributes -->
811
+ """
712
812
 
713
813
  x_stats_pid: int = os.getpid()
714
- """PID of the process that started the wandb-core process to collect system stats for."""
814
+ """PID of the process that started the wandb-core process to collect system stats for.
815
+
816
+ <!-- lazydoc-ignore-class-attributes -->
817
+ """
715
818
 
716
819
  x_stats_sampling_interval: float = Field(default=15.0)
717
820
  """Sampling interval for the system monitor in seconds."""
@@ -720,20 +823,22 @@ class Settings(BaseModel, validate_assignment=True):
720
823
  """Path to the default config file for the neuron-monitor tool.
721
824
 
722
825
  This is used to monitor AWS Trainium devices.
826
+ <!-- lazydoc-ignore-class-attributes -->
723
827
  """
724
828
 
725
829
  x_stats_dcgm_exporter: Optional[str] = None
726
830
  """Endpoint to extract Nvidia DCGM metrics from.
727
831
 
728
- Two options are supported:
729
- - Extract DCGM-related metrics from a query to the Prometheus `/api/v1/query` endpoint.
730
- It is a common practice to aggregate metrics reported by the instances of the DCGM Exporter
731
- running on different nodes in a cluster using Prometheus.
732
- - TODO: Parse metrics directly from the `/metrics` endpoint of the DCGM Exporter.
832
+ Options:
833
+ - Extract DCGM-related metrics from a query to the Prometheus `/api/v1/query` endpoint.
834
+ It is a common practice to aggregate metrics reported by the instances of the DCGM Exporter
835
+ running on different nodes in a cluster using Prometheus.
836
+ - TODO: Parse metrics directly from the `/metrics` endpoint of the DCGM Exporter.
733
837
 
734
838
  Examples:
735
- - `http://localhost:9400/api/v1/query?query=DCGM_FI_DEV_GPU_TEMP{node="l1337", cluster="globular"}`.
736
- - TODO: `http://192.168.0.1:9400/metrics`.
839
+ - `http://localhost:9400/api/v1/query?query=DCGM_FI_DEV_GPU_TEMP{node="l1337", cluster="globular"}`.
840
+ - TODO: `http://192.168.0.1:9400/metrics`.
841
+ <!-- lazydoc-ignore-class-attributes -->
737
842
  """
738
843
 
739
844
  x_stats_open_metrics_endpoints: Optional[Dict[str, str]] = None
@@ -745,24 +850,44 @@ class Settings(BaseModel, validate_assignment=True):
745
850
  """Filter to apply to metrics collected from OpenMetrics `/metrics` endpoints.
746
851
 
747
852
  Supports two formats:
748
- - {"metric regex pattern, including endpoint name as prefix": {"label": "label value regex pattern"}}
749
- - ("metric regex pattern 1", "metric regex pattern 2", ...)
853
+ - {"metric regex pattern, including endpoint name as prefix": {"label": "label value regex pattern"}}
854
+ - ("metric regex pattern 1", "metric regex pattern 2", ...)
750
855
  """
751
856
 
752
857
  x_stats_open_metrics_http_headers: Optional[Dict[str, str]] = None
753
858
  """HTTP headers to add to OpenMetrics requests."""
754
859
 
755
- x_stats_disk_paths: Optional[Sequence[str]] = Field(
756
- default_factory=lambda: ("/", "/System/Volumes/Data")
757
- if platform.system() == "Darwin"
758
- else ("/",)
759
- )
860
+ x_stats_disk_paths: Optional[Sequence[str]] = ("/",)
760
861
  """System paths to monitor for disk usage."""
761
862
 
863
+ x_stats_cpu_count: Optional[int] = None
864
+ """System CPU count.
865
+
866
+ If set, overrides the auto-detected value in the run metadata.
867
+ """
868
+
869
+ x_stats_cpu_logical_count: Optional[int] = None
870
+ """Logical CPU count.
871
+
872
+ If set, overrides the auto-detected value in the run metadata.
873
+ """
874
+
875
+ x_stats_gpu_count: Optional[int] = None
876
+ """GPU device count.
877
+
878
+ If set, overrides the auto-detected value in the run metadata.
879
+ """
880
+
881
+ x_stats_gpu_type: Optional[str] = None
882
+ """GPU device type.
883
+
884
+ If set, overrides the auto-detected value in the run metadata.
885
+ """
886
+
762
887
  x_stats_gpu_device_ids: Optional[Sequence[int]] = None
763
888
  """GPU device indices to monitor.
764
889
 
765
- If not set, captures metrics for all GPUs.
890
+ If not set, the system monitor captures metrics for all GPUs.
766
891
  Assumes 0-based indexing matching CUDA/ROCm device enumeration.
767
892
  """
768
893
 
@@ -770,12 +895,14 @@ class Settings(BaseModel, validate_assignment=True):
770
895
  """Number of system metric samples to buffer in memory in the wandb-core process.
771
896
 
772
897
  Can be accessed via run._system_metrics.
898
+ <!-- lazydoc-ignore-class-attributes -->
773
899
  """
774
900
 
775
901
  x_stats_coreweave_metadata_base_url: str = "http://169.254.169.254"
776
902
  """The scheme and hostname for contacting the CoreWeave metadata server.
777
903
 
778
904
  Only accessible from within a CoreWeave cluster.
905
+ <!-- lazydoc-ignore-class-attributes -->
779
906
  """
780
907
 
781
908
  x_stats_coreweave_metadata_endpoint: str = "/api/v2/cloud-init/meta-data"
@@ -783,10 +910,22 @@ class Settings(BaseModel, validate_assignment=True):
783
910
 
784
911
  This must not include the schema and hostname prefix.
785
912
  Only accessible from within a CoreWeave cluster.
913
+ <!-- lazydoc-ignore-class-attributes -->
914
+ """
915
+
916
+ x_stats_track_process_tree: bool = False
917
+ """Monitor the entire process tree for resource usage, starting from `x_stats_pid`.
918
+
919
+ When `True`, the system monitor aggregates the RSS, CPU%, and thread count
920
+ from the process with PID `x_stats_pid` and all of its descendants.
921
+ This can have a performance overhead and is disabled by default.
786
922
  """
787
923
 
788
924
  x_sync: bool = False
789
- """Flag to indicate whether we are syncing a run from the transaction log."""
925
+ """Flag to indicate whether we are syncing a run from the transaction log.
926
+
927
+ <!-- lazydoc-ignore-class-attributes -->
928
+ """
790
929
 
791
930
  x_update_finish_state: bool = True
792
931
  """Flag to indicate whether this process can update the run's final state on the server.
@@ -905,6 +1044,13 @@ class Settings(BaseModel, validate_assignment=True):
905
1044
  return str(value)
906
1045
  return value
907
1046
 
1047
+ @field_validator("x_extra_http_headers", mode="before")
1048
+ @classmethod
1049
+ def validate_x_extra_http_headers(cls, value):
1050
+ if isinstance(value, str):
1051
+ return json.loads(value)
1052
+ return value
1053
+
908
1054
  @field_validator("x_file_stream_max_line_bytes", mode="after")
909
1055
  @classmethod
910
1056
  def validate_file_stream_max_line_bytes(cls, value):
@@ -1057,6 +1203,11 @@ class Settings(BaseModel, validate_assignment=True):
1057
1203
  raise UsageError("Run ID cannot start or end with whitespace")
1058
1204
  if not bool(value.strip()):
1059
1205
  raise UsageError("Run ID cannot contain only whitespace")
1206
+
1207
+ # check if the run id contains any reserved characters
1208
+ reserved_chars = ":;,#?/'"
1209
+ if any(char in reserved_chars for char in value):
1210
+ raise UsageError(f"Run ID cannot contain the characters: {reserved_chars}")
1060
1211
  return value
1061
1212
 
1062
1213
  @field_validator("settings_system", mode="after")
@@ -1363,7 +1514,9 @@ class Settings(BaseModel, validate_assignment=True):
1363
1514
  return ""
1364
1515
 
1365
1516
  query = self._get_url_query_string()
1366
- return f"{project_url}/runs/{quote(self.run_id or '')}{query}"
1517
+ # Exclude specific safe characters from URL encoding to prevent 404 errors
1518
+ safe_chars = "=+&$@"
1519
+ return f"{project_url}/runs/{quote(self.run_id or '', safe=safe_chars)}{query}"
1367
1520
 
1368
1521
  @computed_field # type: ignore[prop-decorator]
1369
1522
  @property
wandb/sdk/wandb_setup.py CHANGED
@@ -28,7 +28,6 @@ import logging
28
28
  import os
29
29
  import pathlib
30
30
  import sys
31
- import threading
32
31
  from typing import TYPE_CHECKING, Any, Union
33
32
 
34
33
  import wandb
@@ -41,7 +40,7 @@ from .lib import config_util, server
41
40
 
42
41
  if TYPE_CHECKING:
43
42
  from wandb.sdk import wandb_run
44
- from wandb.sdk.lib.service_connection import ServiceConnection
43
+ from wandb.sdk.lib.service.service_connection import ServiceConnection
45
44
  from wandb.sdk.wandb_settings import Settings
46
45
 
47
46
 
@@ -113,7 +112,6 @@ class _WandbSetup:
113
112
 
114
113
  wandb.termsetup(self._settings, None)
115
114
 
116
- self._check()
117
115
  self._setup()
118
116
 
119
117
  def add_active_run(self, run: wandb_run.Run) -> None:
@@ -284,15 +282,6 @@ class _WandbSetup:
284
282
 
285
283
  return user_settings
286
284
 
287
- def _check(self) -> None:
288
- if hasattr(threading, "main_thread"):
289
- if threading.current_thread() is not threading.main_thread():
290
- pass
291
- elif threading.current_thread().name != "MainThread":
292
- wandb.termwarn(f"bad thread2: {threading.current_thread().name}")
293
- if getattr(sys, "frozen", False):
294
- wandb.termwarn("frozen, could be trouble")
295
-
296
285
  def _setup(self) -> None:
297
286
  sweep_path = self._settings.sweep_param_path
298
287
  if sweep_path:
@@ -331,7 +320,7 @@ class _WandbSetup:
331
320
  if self._connection:
332
321
  return self._connection
333
322
 
334
- from wandb.sdk.lib import service_connection
323
+ from wandb.sdk.lib.service import service_connection
335
324
 
336
325
  self._connection = service_connection.connect_to_service(self._settings)
337
326
  return self._connection
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wandb
3
- Version: 0.20.1rc20250604
3
+ Version: 0.21.0
4
4
  Summary: A CLI and library for interacting with the Weights & Biases API.
5
5
  Project-URL: Source, https://github.com/wandb/wandb
6
6
  Project-URL: Bug Reports, https://github.com/wandb/wandb/issues
@@ -56,12 +56,10 @@ Requires-Dist: protobuf!=4.21.0,!=5.28.0,<7,>=3.12.0; python_version < '3.9' and
56
56
  Requires-Dist: protobuf!=4.21.0,!=5.28.0,<7,>=3.15.0; python_version == '3.9' and sys_platform == 'linux'
57
57
  Requires-Dist: protobuf!=4.21.0,!=5.28.0,<7,>=3.19.0; python_version > '3.9' and sys_platform == 'linux'
58
58
  Requires-Dist: protobuf!=4.21.0,!=5.28.0,<7,>=3.19.0; sys_platform != 'linux'
59
- Requires-Dist: psutil>=5.0.0
60
59
  Requires-Dist: pydantic<3
61
60
  Requires-Dist: pyyaml
62
61
  Requires-Dist: requests<3,>=2.0.0
63
62
  Requires-Dist: sentry-sdk>=2.0.0
64
- Requires-Dist: setproctitle
65
63
  Requires-Dist: typing-extensions<5,>=4.8
66
64
  Provides-Extra: aws
67
65
  Requires-Dist: boto3; extra == 'aws'