Ple Table#

class PleTable#

Immutable embedding row layout. Opening validates metadata, not payload digests.

Public Types

enum class DType#

Values:

enumerator kFP8#
enumerator kFP16#
enumerator kBF16#
enumerator kFP32#

Public Functions

RowLocation locate(int64_t row) const#

Translate a valid global row into an exact file range without reading payload bytes.

inline int64_t rowCount() const noexcept#
inline int64_t rowWidth() const noexcept#
inline int64_t rowBytes() const noexcept#
inline DType dtype() const noexcept#
inline DType sourceDtype() const noexcept#
inline int64_t sourceRowBytes() const noexcept#
inline double sourceScale() const noexcept#
inline double scale() const noexcept#
inline std::string const &tableId() const noexcept#
inline std::vector<Shard> const &shards() const noexcept#

Public Static Functions

static PleTable fromSource(
Source const &source,
int64_t rowCount,
int64_t rowWidth,
std::filesystem::path const &checkpointDir,
std::filesystem::path const &dataFile = {},
DType poolDtype = DType::kFP16,
double poolScale = 1.0
)#

Original checkpoint tensor contract. An explicit location describes indexed PyTorch payloads. A table split across tensors sets shards instead of tensorKey, in row order. struct Source { std::string tensorKey; DType dtype{DType::kFP16}; int64_t bytes{}; double scale{1.0}; std::vector<Sample> samples; std::filesystem::path file; int64_t offset{}; std::vector<ShardSource> shards; };

struct Shard { std::filesystem::path path; int64_t rowBegin{}; int64_t rowCount{}; int64_t byteOffset{}; int64_t byteLength{}; };

struct RowLocation { size_t shardIndex{}; int64_t byteOffset{}; };

! Expected identity and scale come from the engine’s bound artifact metadata. static PleTable open(std::filesystem::path const& manifest, std::string const& expectedTableId, double expectedScale, std::filesystem::path const& dataFile = {});

! Resolve the source tensors from a checkpoint or explicit file and validate their metadata and ! bounded samples. poolDtype/poolScale describe the rows the pool will hold, which differ from the source when the fill converts; the defaults are the cast-to-F16 contract.

struct Sample#

Public Members

int64_t offset = {}#
std::string data#
struct ShardSource#

One checkpoint tensor holding a contiguous row range. Sample offsets are relative to it.

Public Members

std::string tensorKey#
int64_t rows = {}#
int64_t bytes = {}#
std::vector<Sample> samples#
std::filesystem::path file#
int64_t offset = {}#
struct Sample

Public Members

int64_t offset = {}
std::string data
struct ShardSource

One checkpoint tensor holding a contiguous row range. Sample offsets are relative to it.

Public Members

std::string tensorKey
int64_t rows = {}
int64_t bytes = {}
std::vector<Sample> samples
std::filesystem::path file
int64_t offset = {}