Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a vector engine #4925

Merged
merged 8 commits into from
Dec 7, 2023
Merged

Add a vector engine #4925

merged 8 commits into from
Dec 7, 2023

Conversation

nwt
Copy link
Member

@nwt nwt commented Dec 5, 2023

  • Add a vector engine in compiler/vam (for vector abstract machine) with a few initial operations

  • Add dag.Vectorize, which tells the compiler to execute operations in its body using the vector engine

  • Add compiler/optimize.Optimizer.Vectorize, which identifies a very limited set of vectorizable operations and wraps them in dag.Vectorize

  • Add complier/kernel.Builder.compileVectorize, which compiles dag.Vectorize

Co-authored-by: @mccanne

mccanne and others added 4 commits December 4, 2023 11:45
fix problem where loading vector and looking up were confounded..
now there is clean separation and a vector path is loaded on demand
and the leaf is returned

handle dotted paths

fix const
The dag.Vectorize node tells the compiler to execute its body using the
vector engine.
@nwt nwt requested a review from a team December 5, 2023 19:26
@nwt
Copy link
Member Author

nwt commented Dec 5, 2023

Tests in runtime/vcache/ztests/ are broken because "zed dev vcache copy" no longer works. I'd like to fix it rather than disable the tests.

@nwt nwt force-pushed the vam-x-vectorize branch from 6e82b85 to 46d5a58 Compare December 5, 2023 19:31
@nwt nwt force-pushed the vam-x-vectorize branch from 23d7554 to f5f97ed Compare December 6, 2023 00:38
Copy link
Collaborator

@mccanne mccanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merge when tests pass.

@nwt
Copy link
Member Author

nwt commented Dec 7, 2023

Tests in runtime/vcache/ztests/ are broken because "zed dev vcache copy" no longer works. I'd like to fix it rather than disable the tests.

We're going to fix "zed dev vcache copy" (and "zed dev vcache project", which is also broken) later, so I've disabled the corresponding tests.

@nwt nwt merged commit cbd5bbd into main Dec 7, 2023
3 checks passed
@nwt nwt deleted the vam-x-vectorize branch December 7, 2023 20:27
nwt added a commit that referenced this pull request Dec 20, 2023
Do that by plugging some holes left by #4925.

* In runtime/vcache/ztests/, re-enable skipped "zed dev vcache copy"
  tests.

* In cmd/zed/dev/vcache/copy.Command.Run, resurrect the call to
  zio.Copy.

* In package runtime/vcache:

  * Resurrect the Reader type and update its Read method.

  * Resurrect Object.NewReader.

  * Add loader type to hold the *zed.Context needed when loading
    a vector of type values and convert existing loadXXX functions to
    loader methods.

  * In loadArray, fix bad nil argument to loadVector.

  * In loadMap, load lengths vector.

  * In loadNulls, create slots slice and load values vector.

  * In loadPrimitive, remove null handling (vector.Nulls now does
    that) and add support for missing Zed types (float16, float32,
    float64, bytes, ip, net, and type).

  * In loadRecord, load all fields when no specific path is requested.

  * In loadUnion, load tags vector.

  * In loadVector, assign to *any when loading a constant vector.

* In package vector:

  * Add missing Byte, Float, IP, Net, and Type types.

  * Add missing length field to Map type.

  * Add missing tags field to Union type.

  * Implement NewBuilder method for Array, Map, and Union types.

  * Handle nulls for all vector types by replacing the Nullmask
    type with Nulls, which wraps a vector.Any.
nwt added a commit that referenced this pull request Dec 20, 2023
Do that by plugging some holes left by #4925.

* In runtime/vcache/ztests/, re-enable skipped "zed dev vcache copy"
  tests.

* In cmd/zed/dev/vcache/copy.Command.Run, resurrect the call to
  zio.Copy.

* In package runtime/vcache:

  * Resurrect the Reader type and update its Read method.

  * Resurrect Object.NewReader.

  * Add loader type to hold the *zed.Context needed when loading
    a vector of type values.

  * Convert existing loadXXX functions to loader methods.

  * In loadArray, fix bad nil argument to loadVector.

  * In loadMap, load lengths vector.

  * In loadNulls, create slots slice and load values vector.

  * In loadPrimitive, remove null handling (vector.Nulls now does
    that) and add support for missing Zed types (float16, float32,
    float64, bytes, ip, net, and type).

  * In loadRecord, load all fields when no specific path is requested.

  * In loadUnion, load tags vector.

  * In loadVector, assign to *any when loading a constant vector.

* In package vector:

  * Add missing Byte, Float, IP, Net, and Type types.

  * Add missing length field to Map type.

  * Add missing tags field to Union type.

  * Implement NewBuilder method for Array, Map, and Union types.

  * Handle nulls for all vector types by replacing the Nullmask
    type with Nulls, which wraps a vector.Any.
@nwt nwt mentioned this pull request Dec 20, 2023
nwt added a commit that referenced this pull request Dec 22, 2023
Do that by plugging some holes left by #4925.

* In runtime/vcache/ztests/, re-enable skipped "zed dev vcache copy"
  tests.

* In cmd/zed/dev/vcache/copy.Command.Run, resurrect the call to
  zio.Copy.

* In package runtime/vcache:

  * Resurrect the Reader type and update its Read method.

  * Resurrect Object.NewReader.

  * Add loader type to hold the *zed.Context needed when loading
    a vector of type values.

  * Convert existing loadXXX functions to loader methods.

  * In loadArray, fix bad nil argument to loadVector.

  * In loadMap, load lengths vector.

  * In loadNulls, create slots slice and load values vector.

  * In loadPrimitive, remove null handling (vector.Nulls now does
    that) and add support for missing Zed types (float16, float32,
    float64, bytes, ip, net, and type).

  * In loadRecord, load all fields when no specific path is requested.

  * In loadUnion, load tags vector.

  * In loadVector, assign to *any when loading a constant vector.

* In package vector:

  * Add missing Byte, Float, IP, Net, and Type types.

  * Add missing length field to Map type.

  * Add missing tags field to Union type.

  * Implement NewBuilder method for Array, Map, and Union types.

  * Handle nulls for all vector types by replacing the Nullmask
    type with Nulls, which wraps a vector.Any.
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.

2 participants