Unity-Technologies / Unity-Technologies/sentis-samples

Runtime burst compilation warning on Tensor<float>.Upload

Open
#29 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
358
Forks
73
PR merge metrics
No merged PRs in 30d

Description

Using Inference Engine 2.3.0 in Unity 6000.2.

I am receiving a warning only the very first time I upload new Tensor data to a Tensor:

TextureConverter.ToTensor( input, inputImageTensor, new TextureTransform( ));
//no warning after this

await Task.Delay( 10000 );

var queryPointNormalized = new Vector2((( float ) queryPoint.x ) / input.width, (( float ) queryPoint.y ) / input.height );
decoderInputs[ "point_coords" ].Upload( new float[ ]{ queryPointNormalized.x * 1024, queryPointNormalized.y * 1024 });
decoderInputs[ "orig_im_size" ].Upload( new float[ ]{ input.height, input.width });
//warning throws after this

await Task.Delay( 10000 );

await RunScheduleInChunks( encoder.ScheduleIterable( inputImageTensor ), encoderMaxLayersPerFrame );

decoder.SetInput( "image_embeddings", encoder.PeekOutput( "embeddings" ) as Tensor< float >); 
await RunScheduleInChunks( decoder.ScheduleIterable( ), decoderMaxLayersPerFrame );
TextureConverter.RenderToTexture( decoder.PeekOutput( "masks" ) as Tensor< float >, output, outputTransform );
var request = await AsyncGPUReadback.RequestAsync( output );

The warning:

Compilation was requested for method Unity.Jobs.IJobExtensions+JobStruct1[[Unity.InferenceEngine.CPUBackend+CopyJob1[[System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]], Unity.InferenceEngine, Version=2.3.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(Unity.InferenceEngine.CPUBackend+CopyJob1[[System.Single, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]&, Unity.InferenceEngine, Version=2.3.0.0, Culture=neutral, PublicKeyToken=null|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)` but it is not a known Burst entry point. This may be because the [BurstCompile] method is defined in a generic class, and the generic class is not instantiated with concrete types anywhere in your code.

Subsequent uploads do not trigger the warning again. Any ideas why this happens and how it can be fixed?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the upload sequence in the issue with Inference Engine 2.3.0 on Unity 6000.2, focusing on the first Tensor.Upload calls and the Burst warning. Trace the related CPUBackend CopyJob and determine whether the warning is expected or requires a change; done means the warning is resolved or its expected behavior is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, unity
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.