Splat-transform performance on Lambda AWS

We are implementing an AWS Lambda that merges splat files from an S3 bucket with the splat-transform tool (GitHub - playcanvas/splat-transform: CLI tool for 3D Gaussian splat format conversion and transformation). Even when increasing the memory allocated to the Lambda (and thus the CPU), we notice that the execution time of the command is about 3 seconds, whereas locally (Mac Mini M2 Pro) it is significantly faster.

Do you know if it is possible to optimize the execution speed? Could it depend on the Node version being used?

Best guess is that the tool could utilising the GPU and the lambda workflow you are using doesn’t have access to hardware GPU or isn’t as powerful as your local Mac?

Only SOG format generation uses GPU if SH is used, so depending on what’s your output format, this might not be the reason.

Is it perhaps download and upload of the data, and not the execution itself?

This is an example of execution on AWS Lambda:

Executing: node /var/task/node_modules/@playcanvas/splat-transform/bin/cli.mjs /tmp/input_0.ply /tmp/input_1.ply /tmp/input_2.ply /tmp/input_3.ply /tmp/input_4.ply /tmp/input_5.ply /tmp/output.compressed.ply

And below are the execution times including download, processing, and upload:

"performance": {
    "downloadTime": 1558,
    "transformTime": 6381,
    "uploadTime": 588,
    "cleanupTime": 14,
    "totalTime": 8544
}

Each input file weighs about 20 MB; locally, the same command takes around 2 seconds.

Lambda functions don’t have GPU support. I’ve noticed that I can optimize the execution time by a couple of seconds by preprocessing the .ply chunks into .compressed.ply and then running the transform only when needed.

Alternatively, it would be ideal to get splat-transform working on a Graviton CPU, which should further improve performance (and also costs less).

I launched an EC2 instance without GPU support (c6i.xlarge with 4 vCPUs and 8 GB RAM), installed the latest version of Node.js, and ran the same command. It takes 3.2 seconds—almost half the time of the Lambda.

The Lambda environment is probably not as performant as an EC2 instance. I’ll keep running tests and, if you’re interested, I’ll keep you updated :wink: