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

GPU Aggregation (3/8): CPUAggregator #8888

Merged
merged 9 commits into from
Jun 22, 2024
Merged

GPU Aggregation (3/8): CPUAggregator #8888

merged 9 commits into from
Jun 22, 2024

Conversation

Pessimistress
Copy link
Collaborator

For #7457

Change List

  • Add CPUAggregator

@Pessimistress Pessimistress force-pushed the x/aggregation-3 branch 3 times, most recently from 795f733 to 78cfdbc Compare May 13, 2024 06:57
Copy link
Collaborator

@ibgreen ibgreen left a comment

Choose a reason for hiding this comment

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

Added some first impressions, will come back again for full review.

@Pessimistress Pessimistress force-pushed the x/aggregation-2 branch 2 times, most recently from c6fae8c to a9f0504 Compare June 10, 2024 01:23
@Pessimistress Pessimistress force-pushed the x/aggregation-3 branch 2 times, most recently from 54ee4f1 to 941cc99 Compare June 11, 2024 14:33
Copy link
Collaborator

@ibgreen ibgreen left a comment

Choose a reason for hiding this comment

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

Looks solid!

};

/** Evaluate a VertexAccessor with a set of attributes */
export function evaluateVertexAccessor<ValueT, OptionsT>(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: If this makes good sense to you then fine. I was trying to understand in what sense we are "evaluating" something here. Since this returns a function, rather than evaluate directly, then maybe getVertexAccessFunction() would be a better name?

For non-rendering processing like aggregation, I personally feel that talking about rows (in a binary columnar table) rather than "vertexes" tends to be more helpful for understanding.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

VertexAccessor is provided by the user. For example,

const getBin: VertexAccessor = {
  sources: ['positions'],
  getValue: ({positions}, index, {binSize} => [
    Math.floor(positions[0] / binSize[0]),
    Math.floor(positions[1] / binSize[1])
  }
}

Directly maps to

in vec2 positions;
uniform vec2 binSize;

void getBin(out vec2 binId) {
  binId = floor(positions / binSize);
}

This function takes user-specified VertexAccessor, attributes and uniforms and returns a value getter at each point index, hence "evaluate".

Base automatically changed from x/aggregation-2 to master June 19, 2024 15:02
@coveralls
Copy link

Coverage Status

coverage: 89.646% (-0.02%) from 89.661%
when pulling 5e69351 on x/aggregation-3
into 92363b3 on master.

@coveralls
Copy link

Coverage Status

coverage: 89.392% (-0.01%) from 89.405%
when pulling 29a12a9 on x/aggregation-3
into cccc99e on master.

@coveralls
Copy link

Coverage Status

coverage: 89.393% (-0.01%) from 89.405%
when pulling 29a12a9 on x/aggregation-3
into cccc99e on master.

@coveralls
Copy link

Coverage Status

coverage: 89.454% (+0.05%) from 89.405%
when pulling 59e0e2d on x/aggregation-3
into cccc99e on master.

@Pessimistress Pessimistress merged commit 928fe1d into master Jun 22, 2024
4 checks passed
@Pessimistress Pessimistress deleted the x/aggregation-3 branch June 22, 2024 18:07
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.

3 participants