Documentation

memory

Memory benchmark result models.

Classes

class

CorpusStats

(BaseModel)

Corpus statistics.

Attributes

NameTypeDescription
edge_featuresint
max_nodeint
max_slotint
namestr
node_featuresint
node_typesint

Methods

to_dict(self) dict

Convert to JSON-serializable dictionary.

class

MemoryBenchmarkResult

(BaseModel)

Aggregated memory benchmark results for one corpus.

Attributes

NameTypeDescription
cf_fork_statsStatisticalSummary | None
cf_load_time_statsStatisticalSummary | None
cf_memory_statsStatisticalSummary | None
cf_spawn_statsStatisticalSummary | None
corpusstr
corpus_statsCorpusStats
measurementslist[MemoryMeasurement]
tf_fork_statsStatisticalSummary | None
tf_load_time_statsStatisticalSummary | None
tf_memory_statsStatisticalSummary | None
tf_spawn_statsStatisticalSummary | None

Methods

get_measurements_by_impl(self, implementation: Literal[('TF', 'CF')]) list[MemoryMeasurement]

Get measurements for a specific implementation.

Parameters
  • implementation: Literal[('TF', 'CF')]
get_measurements_by_mode(self, mode: Literal[('single', 'spawn', 'fork')]) list[MemoryMeasurement]

Get measurements for a specific mode.

Parameters
  • mode: Literal[('single', 'spawn', 'fork')]
to_dict(self) dict

Convert to JSON-serializable dictionary.

to_json(self) str

Serialize to JSON string.

class

MemoryMeasurement

(BaseModel)

Single memory measurement.

Attributes

NameTypeDescription
cache_size_mbfloat | None
compile_time_sfloat | None
corpusstr
implementationLiteral[('TF', 'CF')]
load_time_sfloat
memory_used_mbfloatCalculate memory used (after - before).
modeLiteral[('single', 'spawn', 'fork')]
num_workersint | None
per_worker_rss_mbfloat | None
rss_after_mbfloat
rss_before_mbfloat
run_idint
total_rss_mbfloat | None

Methods

to_dict(self) dict

Convert to JSON-serializable dictionary.