pub struct PythonTorchProject { /* private fields */ }Expand description
Python/Torch-backed workload bridge implemented on top of the generic p2p runtime.
Implementations§
Source§impl PythonTorchProject
impl PythonTorchProject
Sourcepub fn new(config: PythonTorchWorkloadConfig) -> Result<Self>
pub fn new(config: PythonTorchWorkloadConfig) -> Result<Self>
Spawns the backing Python worker and probes its runtime capability.
Sourcepub fn new_with_data_pipeline(
config: PythonTorchWorkloadConfig,
data_pipeline: LeaseDataPipeline<String, PythonBatchRef>,
) -> Result<Self>
pub fn new_with_data_pipeline( config: PythonTorchWorkloadConfig, data_pipeline: LeaseDataPipeline<String, PythonBatchRef>, ) -> Result<Self>
Spawns the backing Python worker with an explicit lease data pipeline.
Sourcepub fn sharded_data_pipeline(
dataset: &PythonTorchDatasetConfig,
) -> LeaseDataPipeline<String, PythonBatchRef>
pub fn sharded_data_pipeline( dataset: &PythonTorchDatasetConfig, ) -> LeaseDataPipeline<String, PythonBatchRef>
Returns the default shard-backed lease data pipeline for one dataset config.
Sourcepub fn micro_epoch_pipeline(
descriptor: LeaseDataPipelineDescriptor,
dataset_registration: impl Fn() -> Result<DatasetRegistration> + Send + Sync + 'static,
microshard_plan: impl Fn(&DatasetRegistration) -> Result<MicroShardPlan> + Send + Sync + 'static,
payload: impl Fn(&AssignmentLease, &[CachedMicroShard]) -> Result<Value> + Send + Sync + 'static,
) -> LeaseDataPipeline<String, PythonBatchRef>
pub fn micro_epoch_pipeline( descriptor: LeaseDataPipelineDescriptor, dataset_registration: impl Fn() -> Result<DatasetRegistration> + Send + Sync + 'static, microshard_plan: impl Fn(&DatasetRegistration) -> Result<MicroShardPlan> + Send + Sync + 'static, payload: impl Fn(&AssignmentLease, &[CachedMicroShard]) -> Result<Value> + Send + Sync + 'static, ) -> LeaseDataPipeline<String, PythonBatchRef>
Builds a generic Python micro-epoch pipeline backed by workload-defined payloads.
Sourcepub fn indexed_dataset_pipeline(
pipeline_name: impl Into<String>,
dataset_registration: impl Fn() -> Result<DatasetRegistration> + Send + Sync + 'static,
microshard_plan: impl Fn(&DatasetRegistration) -> Result<MicroShardPlan> + Send + Sync + 'static,
payload: impl Fn(&AssignmentLease, &[CachedMicroShard]) -> Result<Value> + Send + Sync + 'static,
) -> LeaseDataPipeline<String, PythonBatchRef>
pub fn indexed_dataset_pipeline( pipeline_name: impl Into<String>, dataset_registration: impl Fn() -> Result<DatasetRegistration> + Send + Sync + 'static, microshard_plan: impl Fn(&DatasetRegistration) -> Result<MicroShardPlan> + Send + Sync + 'static, payload: impl Fn(&AssignmentLease, &[CachedMicroShard]) -> Result<Value> + Send + Sync + 'static, ) -> LeaseDataPipeline<String, PythonBatchRef>
Builds a Python pipeline for existing torch Dataset/Sampler-style data flows.
Sourcepub fn generated_dataset_pipeline(
pipeline_name: impl Into<String>,
dataset_registration: impl Fn() -> Result<DatasetRegistration> + Send + Sync + 'static,
microshard_plan: impl Fn(&DatasetRegistration) -> Result<MicroShardPlan> + Send + Sync + 'static,
payload: impl Fn(&AssignmentLease, &[CachedMicroShard]) -> Result<Value> + Send + Sync + 'static,
) -> LeaseDataPipeline<String, PythonBatchRef>
pub fn generated_dataset_pipeline( pipeline_name: impl Into<String>, dataset_registration: impl Fn() -> Result<DatasetRegistration> + Send + Sync + 'static, microshard_plan: impl Fn(&DatasetRegistration) -> Result<MicroShardPlan> + Send + Sync + 'static, payload: impl Fn(&AssignmentLease, &[CachedMicroShard]) -> Result<Value> + Send + Sync + 'static, ) -> LeaseDataPipeline<String, PythonBatchRef>
Builds a Python pipeline for deterministic synthetic or recipe-driven data generation.
Sourcepub fn probe_capability(&self) -> &CapabilityEstimate
pub fn probe_capability(&self) -> &CapabilityEstimate
Returns the worker-advertised capability estimate.
Sourcepub fn runtime_device_name(&self) -> &str
pub fn runtime_device_name(&self) -> &str
Returns the resolved runtime device tag.
Sourcepub fn workload_name(&self) -> &str
pub fn workload_name(&self) -> &str
Returns the Python-side workload name advertised by the worker.
Sourcepub fn data_pipeline_descriptor(&self) -> &LeaseDataPipelineDescriptor
pub fn data_pipeline_descriptor(&self) -> &LeaseDataPipelineDescriptor
Returns the static lease/micro-epoch data pipeline descriptor.
Sourcepub fn data_pipeline_kind(&self) -> LeaseDataPipelineKind
pub fn data_pipeline_kind(&self) -> LeaseDataPipelineKind
Returns the configured lease/micro-epoch pipeline kind.
Sourcepub fn data_pipeline_registration(&self) -> Result<DatasetRegistration>
pub fn data_pipeline_registration(&self) -> Result<DatasetRegistration>
Returns the dataset registration backing the current pipeline.
Sourcepub fn local_upstream_root(&self) -> Result<Option<PathBuf>>
pub fn local_upstream_root(&self) -> Result<Option<PathBuf>>
Returns the local upstream root when the current pipeline is backed by
a Local dataset registration.
Sourcepub fn configured_shard_root(&self) -> &Path
pub fn configured_shard_root(&self) -> &Path
Returns the configured shard root for the default sharded Python dataset
config. This is configuration data only and may be unrelated to the
active pipeline when new_with_data_pipeline(...) is used.
Trait Implementations§
Source§impl Clone for PythonTorchProject
impl Clone for PythonTorchProject
Source§fn clone(&self) -> PythonTorchProject
fn clone(&self) -> PythonTorchProject
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more