Skip to content

Introduce the InMemoryDataSet interface. - #718

Draft
ashkrisk wants to merge 1 commit into
ltm-ds/resolvefrom
ltm-ds/in-mem-ds
Draft

Introduce the InMemoryDataSet interface.#718
ashkrisk wants to merge 1 commit into
ltm-ds/resolvefrom
ltm-ds/in-mem-ds

Conversation

@ashkrisk

Copy link
Copy Markdown
Contributor

Separate part of functionality provided by the DataSet interface into the InMemoryDataSet interface to allow for DataSets that are not held in-memory.

The current DataSet interface requires all the base vectors in the corpus to be made available as a List<VectorFloat<?>>. This makes it difficult to create a DataSet implementation that reads data from disk without manifesting it in-memory.

To solve this, the new InMemoryDataSet interface is created and the scope of the original DataSet interface is reduced. The DataSet interface no longer provides all base vectors in memory, however, it retains the ability to acces base vectors through a RAVV.

Summary of changes:

  • Split-off getBaseVectors from the DataSet interface into the InMemoryDataSet interface
  • References to getBaseVectors are scrubbed from Grid to allow it to use the reduced DataSet interface. No performance impact is expected since Grid only used the base vector list for counting the number of vectors.
  • CompactorBenchmark (and by extension, AutoBenchYAML) now uses InMemoryDataSet instead of the plain DataSet. The list of base vectors is used for partitioning, and porting this to the reduced DataSet interface is left to future patches.

Separate part of functionality provided by the `DataSet` interface into
the `InMemoryDataSet` interface to allow for DataSets that are not held
in-memory.

The current `DataSet` interface requires all the base vectors in the
corpus to be made available as a `List<VectorFloat<?>>`. This makes it
difficult to create a `DataSet` implementation that reads data from disk
without manifesting it in-memory.

To solve this, the new `InMemoryDataSet` interface is created and the
scope of the original `DataSet` interface is reduced. The `DataSet`
interface no longer provides all base vectors in memory, however, it
retains the ability to acces base vectors through a RAVV.

Summary of changes:
- Split-off `getBaseVectors` from the `DataSet` interface into the
  `InMemoryDataSet` interface
- References to `getBaseVectors` are scrubbed from `Grid` to allow it to
  use the reduced `DataSet` interface. No performance impact is expected
  since `Grid` only used the base vector list for counting the number of
  vectors.
- `CompactorBenchmark` (and by extension, `AutoBenchYAML`) now uses
  `InMemoryDataSet` instead of the plain `DataSet`. The list of base
  vectors is used for partitioning, and porting this to the reduced
  `DataSet` interface is left to future patches.
@github-actions

Copy link
Copy Markdown
Contributor

Before you submit for review:

  • Does your PR follow guidelines from CONTRIBUTIONS.md?
  • Did you summarize what this PR does clearly and concisely?
  • Did you include performance data for changes which may be performance impacting?
  • Did you include useful docs for any user-facing changes or features?
  • Did you include useful javadocs for developer oriented changes, explaining new concepts or key changes?
  • Did you rebase your branch onto the latest main for regression testing and PR submission?
  • Did you trigger regression testing via Run Bench Main and review results?
  • Did you adhere to the code formatting guidelines (TBD)
  • Did you group your changes for easy review, providing meaningful descriptions for each commit?
  • Did you ensure that all files contain the correct copyright header?
  • Did you add documentation for this feature to the release notes directory?

If you did not complete any of these, then please explain below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant