From 636c616d148b4235a9cd51b92683e06bb4e02c8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rousset?= Date: Tue, 8 Oct 2024 20:35:37 +0200 Subject: [PATCH 01/17] [tfjs-data] support async generator (#8408) --- tfjs-data/src/readers.ts | 19 +++++++++---------- tfjs-data/src/readers_test.ts | 15 +++++++++++++++ 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/tfjs-data/src/readers.ts b/tfjs-data/src/readers.ts index ed93a55577c..070874c4f5a 100644 --- a/tfjs-data/src/readers.ts +++ b/tfjs-data/src/readers.ts @@ -140,14 +140,12 @@ export function func( /** * Create a `Dataset` that produces each element from provided JavaScript - * generator, which is a function* - * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions), - * or a function that returns an - * iterator - * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators#Generator_functions). + * generator, which is a function that returns a (potentially async) iterator. * - * The returned iterator should have `.next()` function that returns element in - * format of `{value: TensorContainer, done:boolean}`. + * For more information on iterators and generators, see + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators . + * For the iterator protocol, see + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols . * * Example of creating a dataset from an iterator factory: * ```js @@ -188,8 +186,8 @@ export function func( * await ds.forEachAsync(e => console.log(e)); * ``` * - * @param generator A JavaScript generator function that returns a JavaScript - * iterator. + * @param generator A JavaScript function that returns + * a (potentially async) JavaScript iterator. * * @doc { * heading: 'Data', @@ -199,7 +197,8 @@ export function func( * } */ export function generator( - generator: () => Iterator| Promise>): Dataset { + generator: () => Iterator | Promise> | AsyncIterator, +): Dataset { return datasetFromIteratorFn(async () => { const gen = await generator(); return iteratorFromFunction(() => gen.next()); diff --git a/tfjs-data/src/readers_test.ts b/tfjs-data/src/readers_test.ts index 740ef2d6cbb..4a4bdb6306c 100644 --- a/tfjs-data/src/readers_test.ts +++ b/tfjs-data/src/readers_test.ts @@ -45,6 +45,21 @@ describeAllEnvs('readers', () => { expect(result).toEqual([0, 1, 2, 3, 4]); }); + it('generate dataset from async generator', async () => { + async function* dataGenerator() { + const numElements = 5; + let index = 0; + while (index < numElements) { + const x = index; + index++; + yield x; + } + } + const ds = tfd.generator(dataGenerator); + const result = await ds.toArrayForTest(); + expect(result).toEqual([0, 1, 2, 3, 4]); + }); + it('generate multiple datasets from JavaScript generator', async () => { function* dataGenerator() { const numElements = 5; From 15c00f8948534b8c2a3a59113872c0206e06dd2f Mon Sep 17 00:00:00 2001 From: gaikwadrahul8 <115997457+gaikwadrahul8@users.noreply.github.com> Date: Fri, 11 Oct 2024 03:33:13 +0530 Subject: [PATCH 02/17] Fix typos in the documentation strings of the tfjs-layers directory (#8411) --- tfjs-layers/README.md | 2 +- tfjs-layers/demos/README.md | 2 +- .../src/layers/nlp/modeling/transformer_decoder_test.ts | 4 ++-- tfjs-layers/src/layers/nlp/models/gpt2/gpt2_causal_lm.ts | 2 +- tfjs-layers/src/layers/nlp/multihead_attention.ts | 2 +- tfjs-layers/src/layers/normalization.ts | 2 +- tfjs-layers/src/layers/normalization_test.ts | 4 ++-- .../src/layers/preprocessing/image_resizing_test.ts | 2 +- tfjs-layers/src/layers/preprocessing/random_height.ts | 4 ++-- tfjs-layers/src/layers/preprocessing/random_width.ts | 4 ++-- tfjs-layers/src/layers/recurrent.ts | 8 ++++---- 11 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tfjs-layers/README.md b/tfjs-layers/README.md index cd462791eb9..1fd735fce4c 100644 --- a/tfjs-layers/README.md +++ b/tfjs-layers/README.md @@ -52,7 +52,7 @@ const ys = tf.tensor2d([[1], [3], [5], [7]], [4, 1]); // Train the model. await model.fit(xs, ys, {epochs: 500}); -// Ater the training, perform inference. +// After the training, perform inference. const output = model.predict(tf.tensor2d([[5]], [1, 1])); output.print(); ``` diff --git a/tfjs-layers/demos/README.md b/tfjs-layers/demos/README.md index 3930909f743..71385b3818e 100644 --- a/tfjs-layers/demos/README.md +++ b/tfjs-layers/demos/README.md @@ -16,7 +16,7 @@ Once the development environment is prepared, execute the build script from the ``` The script will construct a number of Keras models in Python and benchmark their training using the TensorFlow backend. When it is complete, it will bring up a -local HTTP server. Navigate to the local URL spcecified in stdout to bring up +local HTTP server. Navigate to the local URL specified in stdout to bring up the benchmarks page UI. There will be a button to begin the JS side of the benchmarks. Clicking the button will run through and time the same models, now running in the browser. diff --git a/tfjs-layers/src/layers/nlp/modeling/transformer_decoder_test.ts b/tfjs-layers/src/layers/nlp/modeling/transformer_decoder_test.ts index a2a03045b54..b0b0aa15bff 100644 --- a/tfjs-layers/src/layers/nlp/modeling/transformer_decoder_test.ts +++ b/tfjs-layers/src/layers/nlp/modeling/transformer_decoder_test.ts @@ -106,7 +106,7 @@ describe('TransformerDecoder', () => { const config = testLayer.getConfig(); const restored = TransformerDecoder.fromConfig(TransformerDecoder, config); - // Initializers don't get serailized with customObjects. + // Initializers don't get serialized with customObjects. delete ((config['kernelInitializer'] as serialization.ConfigDict )['config'] as serialization.ConfigDict)['customObjects']; delete ((config['biasInitializer'] as serialization.ConfigDict @@ -167,5 +167,5 @@ describe('TransformerDecoder', () => { expectTensorsClose(outputCache, noLoopCache); }); - // TODO(pforderique): Test mask propogation once supported. + // TODO(pforderique): Test mask propagation once supported. }); diff --git a/tfjs-layers/src/layers/nlp/models/gpt2/gpt2_causal_lm.ts b/tfjs-layers/src/layers/nlp/models/gpt2/gpt2_causal_lm.ts index b859e16e27f..f96b37f5d7f 100644 --- a/tfjs-layers/src/layers/nlp/models/gpt2/gpt2_causal_lm.ts +++ b/tfjs-layers/src/layers/nlp/models/gpt2/gpt2_causal_lm.ts @@ -70,7 +70,7 @@ export declare interface GPT2CausalLMArgs extends PipelineModelArgs { } /** - * An end-to-end GPT2 model for causal langauge modeling. + * An end-to-end GPT2 model for causal language modeling. * * A causal language model (LM) predicts the next token based on previous * tokens. This task setup can be used to train the model unsupervised on diff --git a/tfjs-layers/src/layers/nlp/multihead_attention.ts b/tfjs-layers/src/layers/nlp/multihead_attention.ts index 46253c117c3..8c9df5ea27c 100644 --- a/tfjs-layers/src/layers/nlp/multihead_attention.ts +++ b/tfjs-layers/src/layers/nlp/multihead_attention.ts @@ -703,7 +703,7 @@ export class MultiHeadAttention extends Layer { newInputs = [inputs, kwargs['value']].concat(kwargs['key'] ?? []); - // TODO(pforderique): Support mask propogation. + // TODO(pforderique): Support mask propagation. return super.apply(newInputs, kwargs); } diff --git a/tfjs-layers/src/layers/normalization.ts b/tfjs-layers/src/layers/normalization.ts index 03193c83af0..1e4f8c56b8c 100644 --- a/tfjs-layers/src/layers/normalization.ts +++ b/tfjs-layers/src/layers/normalization.ts @@ -430,7 +430,7 @@ export interface LayerNormalizationLayerArgs extends LayerArgs { axis?: number|number[]; /** - * A small positive float added to variance to avoid divison by zero. + * A small positive float added to variance to avoid division by zero. * Defaults to 1e-3. */ epsilon?: number; diff --git a/tfjs-layers/src/layers/normalization_test.ts b/tfjs-layers/src/layers/normalization_test.ts index b7e3db11c6c..ad02fcf8fb4 100644 --- a/tfjs-layers/src/layers/normalization_test.ts +++ b/tfjs-layers/src/layers/normalization_test.ts @@ -353,7 +353,7 @@ describeMathCPUAndWebGL2('BatchNormalization Layers: Tensor', () => { const x = tensor2d([[1, 2], [3, 4]], [2, 2]); expectTensorsClose(layer.apply(x) as Tensor, x, 0.01); expect(layer.getWeights().length).toEqual(3); - // Firt weight is gamma. + // First weight is gamma. expectTensorsClose(layer.getWeights()[0], onesLike(layer.getWeights()[0])); // Second weight is moving mean. expectTensorsClose(layer.getWeights()[1], zerosLike(layer.getWeights()[1])); @@ -366,7 +366,7 @@ describeMathCPUAndWebGL2('BatchNormalization Layers: Tensor', () => { const x = tensor2d([[1, 2], [3, 4]], [2, 2]); expectTensorsClose(layer.apply(x) as Tensor, x, 0.01); expect(layer.getWeights().length).toEqual(3); - // Firt weight is beta. + // First weight is beta. expectTensorsClose(layer.getWeights()[0], zerosLike(layer.getWeights()[0])); // Second weight is moving mean. expectTensorsClose(layer.getWeights()[1], zerosLike(layer.getWeights()[1])); diff --git a/tfjs-layers/src/layers/preprocessing/image_resizing_test.ts b/tfjs-layers/src/layers/preprocessing/image_resizing_test.ts index 9afc0b7f85d..85089e771f7 100644 --- a/tfjs-layers/src/layers/preprocessing/image_resizing_test.ts +++ b/tfjs-layers/src/layers/preprocessing/image_resizing_test.ts @@ -88,7 +88,7 @@ describeMathCPUAndGPU('Resizing Layer', () => { }); it('Returns a tensor of the correct dtype', () => { - // do a same resizing operation, cheeck tensors dtypes and content + // do a same resizing operation, check tensors dtypes and content const height = 40; const width = 60; const numChannels = 3; diff --git a/tfjs-layers/src/layers/preprocessing/random_height.ts b/tfjs-layers/src/layers/preprocessing/random_height.ts index fa21f371e53..728d58c4bad 100644 --- a/tfjs-layers/src/layers/preprocessing/random_height.ts +++ b/tfjs-layers/src/layers/preprocessing/random_height.ts @@ -35,7 +35,7 @@ type InterpolationType = typeof INTERPOLATION_KEYS[number]; * * The input should be a 3D (unbatched) or * 4D (batched) tensor in the `"channels_last"` image data format. Input pixel - * values can be of any range (e.g. `[0., 1.)` or `[0, 255]`) and of interger + * values can be of any range (e.g. `[0., 1.)` or `[0, 255]`) and of integer * or floating point dtype. By default, the layer will output floats. * * tf methods implemented in tfjs: 'bilinear', 'nearest', @@ -48,7 +48,7 @@ export class RandomHeight extends BaseRandomLayer { /** @nocollapse */ static override className = 'RandomHeight'; private readonly factor: number | [number, number]; - private readonly interpolation?: InterpolationType; // defualt = 'bilinear + private readonly interpolation?: InterpolationType; // default = 'bilinear private heightLower: number; private heightUpper: number; private imgWidth: number; diff --git a/tfjs-layers/src/layers/preprocessing/random_width.ts b/tfjs-layers/src/layers/preprocessing/random_width.ts index 60b71490e6e..c969bd9c505 100644 --- a/tfjs-layers/src/layers/preprocessing/random_width.ts +++ b/tfjs-layers/src/layers/preprocessing/random_width.ts @@ -35,7 +35,7 @@ type InterpolationType = typeof INTERPOLATION_KEYS[number]; * * The input should be a 3D (unbatched) or * 4D (batched) tensor in the `"channels_last"` image data format. Input pixel - * values can be of any range (e.g. `[0., 1.)` or `[0, 255]`) and of interger + * values can be of any range (e.g. `[0., 1.)` or `[0, 255]`) and of integer * or floating point dtype. By default, the layer will output floats. * * tf methods implemented in tfjs: 'bilinear', 'nearest', @@ -48,7 +48,7 @@ export class RandomWidth extends BaseRandomLayer { /** @nocollapse */ static override className = 'RandomWidth'; private readonly factor: number | [number, number]; - private readonly interpolation?: InterpolationType; // defualt = 'bilinear + private readonly interpolation?: InterpolationType; // default = 'bilinear private widthLower: number; private widthUpper: number; private imgHeight: number; diff --git a/tfjs-layers/src/layers/recurrent.ts b/tfjs-layers/src/layers/recurrent.ts index b2af94772ed..95153ca239c 100644 --- a/tfjs-layers/src/layers/recurrent.ts +++ b/tfjs-layers/src/layers/recurrent.ts @@ -252,7 +252,7 @@ export declare interface BaseRNNLayerArgs extends LayerArgs { * see section "Note on passing external constants" below. * Porting Node: PyKeras overrides the `call()` signature of RNN cells, * which are Layer subtypes, to accept two arguments. tfjs-layers does - * not do such overriding. Instead we preseve the `call()` signature, + * not do such overriding. Instead we preserve the `call()` signature, * which due to its `Tensor|Tensor[]` argument and return value is * flexible enough to handle the inputs and states. * - a `stateSize` attribute. This can be a single integer (single state) @@ -757,7 +757,7 @@ export class RNN extends Layer { const output = this.returnSequences ? outputs : lastOutput; - // TODO(cais): Porperty set learning phase flag. + // TODO(cais): Property set learning phase flag. if (this.returnState) { return [output].concat(states); @@ -1933,7 +1933,7 @@ export class StackedRNNCells extends RNNCell { get stateSize(): number[] { // States are a flat list in reverse order of the cell stack. - // This allows perserving the requirement `stack.statesize[0] === + // This allows preserving the requirement `stack.statesize[0] === // outputDim`. E.g., states of a 2-layer LSTM would be `[h2, c2, h1, c1]`, // assuming one LSTM has states `[h, c]`. const stateSize: number[] = []; @@ -2098,7 +2098,7 @@ export class StackedRNNCells extends RNNCell { batchSetValue(tuples); } - // TODO(cais): Maybe implemnt `losses` and `getLossesFor`. + // TODO(cais): Maybe implement `losses` and `getLossesFor`. } serialization.registerClass(StackedRNNCells); From 8206e95ff5b6da2e2d69f950b35082e488783018 Mon Sep 17 00:00:00 2001 From: gaikwadrahul8 <115997457+gaikwadrahul8@users.noreply.github.com> Date: Fri, 11 Oct 2024 03:50:47 +0530 Subject: [PATCH 03/17] Fix typos in the documentation strings of the tfjs-node directory (#8412) --- tfjs-node/WINDOWS_TROUBLESHOOTING.md | 6 +++--- tfjs-node/binding/tfjs_backend.cc | 4 ++-- tfjs-node/binding/tfjs_backend.h | 2 +- tfjs-node/scripts/make-version | 2 +- tfjs-node/src/callbacks.ts | 4 ++-- tfjs-node/src/io/file_system_test.ts | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tfjs-node/WINDOWS_TROUBLESHOOTING.md b/tfjs-node/WINDOWS_TROUBLESHOOTING.md index 3e7a36aa7ee..c20b72df52c 100644 --- a/tfjs-node/WINDOWS_TROUBLESHOOTING.md +++ b/tfjs-node/WINDOWS_TROUBLESHOOTING.md @@ -7,7 +7,7 @@ The tfjs-node package uses the [node-gyp](https://github.com/nodejs/node-gyp) pa This can happen for a variety of reasons. First, to inspect what is missing either `cd node_modules/@tensorflow/tfjs-node` or clone the [tensorflow/tfjs repo](https://github.com/tensorflow/tfjs). -After `cd`'ing or cloning, run the following command (you might need node-gyp installed globablly `npm install -g node-gyp`): +After `cd`'ing or cloning, run the following command (you might need node-gyp installed globally `npm install -g node-gyp`): ```sh node-gyp configure --verbose @@ -22,9 +22,9 @@ gyp verb check python checking for Python executable "python2" in the PATH gyp verb `which` failed Error: not found: python2 ``` -This means that node-gyp expects a 'python2' exe somewhere in `%PATH%`. Try running this command from an Admin (elevated privilaged prompt): +This means that node-gyp expects a 'python2' exe somewhere in `%PATH%`. Try running this command from an Admin (elevated privileged prompt): -You can try running this from an Adminstrative prompt: +You can try running this from an Administrative prompt: ```sh $ npm --add-python-to-path='true' --debug install --global windows-build-tools diff --git a/tfjs-node/binding/tfjs_backend.cc b/tfjs-node/binding/tfjs_backend.cc index f17efd2df23..4267cf5b960 100644 --- a/tfjs-node/binding/tfjs_backend.cc +++ b/tfjs-node/binding/tfjs_backend.cc @@ -135,7 +135,7 @@ TFE_TensorHandle *CreateTFE_TensorHandleFromTypedArray(napi_env env, if (dtype == TF_INT64) { // Currently, int64-type Tensors are represented as Int32Arrays. // To represent a int64-type Tensor of `n` elements, an Int32Array of - // length `2 * n` is requried. This is why the length-match checking + // length `2 * n` is required. This is why the length-match checking // logic is special-cased for int64. if (array_length != num_elements * 2) { NAPI_THROW_ERROR( @@ -379,7 +379,7 @@ void CopyTFE_TensorHandleDataToResourceArray( TF_AutoStatus status; - // Create a JS string to stash the resouce handle into. + // Create a JS string to stash the resource handle into. napi_status nstatus; size_t byte_length = TF_TensorByteSize(tensor.tensor); nstatus = napi_create_array_with_length(env, byte_length, result); diff --git a/tfjs-node/binding/tfjs_backend.h b/tfjs-node/binding/tfjs_backend.h index ca85bc2116c..fee71d06074 100644 --- a/tfjs-node/binding/tfjs_backend.h +++ b/tfjs-node/binding/tfjs_backend.h @@ -36,7 +36,7 @@ class TFJSBackend { static TFJSBackend *Create(napi_env env); // Creates a new Tensor with given shape and data and returns an ID that - // refernces the new Tensor. + // references the new Tensor. // - shape_value (number[]) // - dtype_value (number) // - array_value (TypedArray|Array) diff --git a/tfjs-node/scripts/make-version b/tfjs-node/scripts/make-version index c3379eb910f..b062e0c79fa 100755 --- a/tfjs-node/scripts/make-version +++ b/tfjs-node/scripts/make-version @@ -33,5 +33,5 @@ fs.writeFile('src/version.ts', versionCode, err => { if (err) { throw new Error(`Could not save version file ${version}: ${err}`); } - console.log(`Version file for version ${version} saved sucessfully.`); + console.log(`Version file for version ${version} saved successfully.`); }); diff --git a/tfjs-node/src/callbacks.ts b/tfjs-node/src/callbacks.ts index eabd3a38205..c58da7932d5 100644 --- a/tfjs-node/src/callbacks.ts +++ b/tfjs-node/src/callbacks.ts @@ -46,7 +46,7 @@ export class ProgbarLogger extends CustomCallback { private readonly RENDER_THROTTLE_MS = 50; /** - * Construtor of LoggingCallback. + * Constructor of LoggingCallback. */ constructor() { super({ @@ -150,7 +150,7 @@ const BASE_NUM_DIGITS = 2; const MAX_NUM_DECIMAL_PLACES = 4; /** - * Get a succint string representation of a number. + * Get a succinct string representation of a number. * * Uses decimal notation if the number isn't too small. * Otherwise, use engineering notation. diff --git a/tfjs-node/src/io/file_system_test.ts b/tfjs-node/src/io/file_system_test.ts index 13627f55da5..dda594d25b7 100644 --- a/tfjs-node/src/io/file_system_test.ts +++ b/tfjs-node/src/io/file_system_test.ts @@ -445,7 +445,7 @@ describe('File system IOHandler', () => { const history2 = await model2.fit(xs, ys, {epochs: 2, shuffle: false, verbose: 0}); // The final loss value from training the model twice, 2 epochs - // at a time, should be equal to the final loss of trainig the + // at a time, should be equal to the final loss of training the // model only once with 4 epochs. expect(history2.history.loss[1]).toBeCloseTo(18.603); }); From 8d594e32cad5c2d61f94266328d626ecb446b395 Mon Sep 17 00:00:00 2001 From: gaikwadrahul8 <115997457+gaikwadrahul8@users.noreply.github.com> Date: Fri, 11 Oct 2024 04:54:41 +0530 Subject: [PATCH 04/17] Fix typos in the documentation strings of the tfjs-core directory (#8413) --- tfjs-core/scripts/cloud_funcs/README.md | 4 ++-- tfjs-core/src/backends/complex_util.ts | 2 +- tfjs-core/src/backends/einsum_util.ts | 2 +- tfjs-core/src/backends/non_max_suppression_impl.ts | 2 +- tfjs-core/src/engine.ts | 2 +- tfjs-core/src/engine_test.ts | 2 +- tfjs-core/src/io/browser_files_test.ts | 2 +- tfjs-core/src/io/composite_array_buffer.ts | 2 +- tfjs-core/src/io/http.ts | 2 +- tfjs-core/src/io/indexed_db.ts | 2 +- tfjs-core/src/jasmine_util.ts | 4 ++-- tfjs-core/src/ops/depthwise_conv2d_test.ts | 2 +- tfjs-core/src/ops/ragged_tensor_to_tensor.ts | 2 +- tfjs-core/src/serialization.ts | 2 +- tfjs-core/src/tensor.ts | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tfjs-core/scripts/cloud_funcs/README.md b/tfjs-core/scripts/cloud_funcs/README.md index 2d56e9e01ec..7f4977926bf 100644 --- a/tfjs-core/scripts/cloud_funcs/README.md +++ b/tfjs-core/scripts/cloud_funcs/README.md @@ -1,7 +1,7 @@ This directory contains the following Google Cloud Functions. ### `trigger_nightly` -Programatically triggers a Cloud Build on master. This function is called by the Cloud Scheduler at 3am EST every day (configurable via the Cloud Scheduler UI). +Programmatically triggers a Cloud Build on master. This function is called by the Cloud Scheduler at 3am EST every day (configurable via the Cloud Scheduler UI). You can also trigger the function manually via the Cloud UI. Command to re-deploy: @@ -45,6 +45,6 @@ gcloud functions deploy sync_reactnative \ The pipeline looks like this: 1) At 3am, Cloud Scheduler writes to `nightly` topic -2) That triggers the `nightly` function, which starts a build programatically +2) That triggers the `nightly` function, which starts a build programmatically 3) That build runs and writes its status to `cloud-builds` topic 4) That triggers the `send_email` function, which sends email and chat with the build status. diff --git a/tfjs-core/src/backends/complex_util.ts b/tfjs-core/src/backends/complex_util.ts index 28bfdd05260..59e78069f3b 100644 --- a/tfjs-core/src/backends/complex_util.ts +++ b/tfjs-core/src/backends/complex_util.ts @@ -87,7 +87,7 @@ export function complexWithEvenIndex(complex: Float32Array): } /** - * Extracts odd indexed comple values in the given array. + * Extracts odd indexed complete values in the given array. * @param complex The complex tensor values */ export function complexWithOddIndex(complex: Float32Array): diff --git a/tfjs-core/src/backends/einsum_util.ts b/tfjs-core/src/backends/einsum_util.ts index aef34779f71..ff96aa278a7 100644 --- a/tfjs-core/src/backends/einsum_util.ts +++ b/tfjs-core/src/backends/einsum_util.ts @@ -167,7 +167,7 @@ export function checkEinsumDimSizes( * * @param summedDims indices to the dimensions being summed over. * @param idDims A look up table for the dimensions present in each input - * tensor. Each consituent array contains indices for the dimensions in the + * tensor.Each constituent array contains indices for the dimensions in the * corresponding input tensor. * * @return A map with two fields: diff --git a/tfjs-core/src/backends/non_max_suppression_impl.ts b/tfjs-core/src/backends/non_max_suppression_impl.ts index 51b45a57799..9b8683c6943 100644 --- a/tfjs-core/src/backends/non_max_suppression_impl.ts +++ b/tfjs-core/src/backends/non_max_suppression_impl.ts @@ -188,7 +188,7 @@ function intersectionOverUnion(boxes: TypedArray, i: number, j: number) { // A Gaussian penalty function, this method always returns values in [0, 1]. // The weight is a function of similarity, the more overlap two boxes are, the -// smaller the weight is, meaning highly overlapping boxe will be significantly +// smaller the weight is,meaning highly overlapping boxes will be significantly // penalized. On the other hand, a non-overlapping box will not be penalized. function suppressWeight(iouThreshold: number, scale: number, iou: number) { const weight = Math.exp(scale * iou * iou); diff --git a/tfjs-core/src/engine.ts b/tfjs-core/src/engine.ts index a29b04c24aa..0fec3e3b1f2 100644 --- a/tfjs-core/src/engine.ts +++ b/tfjs-core/src/engine.ts @@ -313,7 +313,7 @@ export class Engine implements TensorTracker, DataMover { /** * Initializes a backend by looking up the backend name in the factory * registry and calling the factory method. Returns a boolean representing - * whether the initialization of the backend suceeded. Throws an error if + * whether the initialization of the backend succeeded. Throws an error if * there is no backend in the factory registry. */ private initializeBackend(backendName: string): diff --git a/tfjs-core/src/engine_test.ts b/tfjs-core/src/engine_test.ts index 97b7e787114..6389c604b2b 100644 --- a/tfjs-core/src/engine_test.ts +++ b/tfjs-core/src/engine_test.ts @@ -243,7 +243,7 @@ describe('Backend registration', () => { throw new Error('failed to create async2'); }, 101 /* priority */); - // Await for the library to find the best backend that succesfully + // Await for the library to find the best backend that successfully // initializes. await tf.ready(); expect(tf.backend()).toEqual(testBackend); diff --git a/tfjs-core/src/io/browser_files_test.ts b/tfjs-core/src/io/browser_files_test.ts index 349cc1f172c..f48d15ebdeb 100644 --- a/tfjs-core/src/io/browser_files_test.ts +++ b/tfjs-core/src/io/browser_files_test.ts @@ -259,7 +259,7 @@ describeWithFlags('browserDownloads', BROWSER_ENVS, () => { // Verify that the default file names are used. expect(jsonAnchor.download).toEqual('model.json'); expect(jsonAnchor.clicked).toEqual(1); - // The weight file should not have been downoaded. + // The weight file should not have been downloaded. expect(weightDataAnchor.download).toEqual(undefined); expect(weightDataAnchor.clicked).toEqual(0); diff --git a/tfjs-core/src/io/composite_array_buffer.ts b/tfjs-core/src/io/composite_array_buffer.ts index 411fb074083..76015b9abdb 100644 --- a/tfjs-core/src/io/composite_array_buffer.ts +++ b/tfjs-core/src/io/composite_array_buffer.ts @@ -91,7 +91,7 @@ export class CompositeArrayBuffer { start = end; } - // Set the byteLenghth + // Set the byteLength if (this.shards.length === 0) { this.byteLength = 0; } diff --git a/tfjs-core/src/io/http.ts b/tfjs-core/src/io/http.ts index a8ba2da62ca..e5d1020a0ca 100644 --- a/tfjs-core/src/io/http.ts +++ b/tfjs-core/src/io/http.ts @@ -324,7 +324,7 @@ IORouterRegistry.registerLoadRouter(httpRouter); * The following GitHub Gist * https://gist.github.com/dsmilkov/1b6046fd6132d7408d5257b0976f7864 * implements a server based on [flask](https://github.com/pallets/flask) that - * can receive the request. Upon receiving the model artifacts via the requst, + * can receive the request. Upon receiving the model artifacts via the request, * this particular server reconstitutes instances of [Keras * Models](https://keras.io/models/model/) in memory. * diff --git a/tfjs-core/src/io/indexed_db.ts b/tfjs-core/src/io/indexed_db.ts index 42de509413d..2eb479b192f 100644 --- a/tfjs-core/src/io/indexed_db.ts +++ b/tfjs-core/src/io/indexed_db.ts @@ -255,7 +255,7 @@ IORouterRegistry.registerLoadRouter(indexedDBRouter); * * @param modelPath A unique identifier for the model to be saved. Must be a * non-empty string. - * @returns An instance of `BrowserIndexedDB` (sublcass of `IOHandler`), + * @returns An instance of `BrowserIndexedDB` (subclass of `IOHandler`), * which can be used with, e.g., `tf.Model.save`. */ export function browserIndexedDB(modelPath: string): IOHandler { diff --git a/tfjs-core/src/jasmine_util.ts b/tfjs-core/src/jasmine_util.ts index 19f554d18f6..bf5d28e1b9c 100644 --- a/tfjs-core/src/jasmine_util.ts +++ b/tfjs-core/src/jasmine_util.ts @@ -105,7 +105,7 @@ export interface TestFilter { * Tests that have the substrings specified by the include or startsWith * will be included in the test run, unless one of the substrings specified * by `excludes` appears in the name. - * @param customInclude Function to programatically include a test. + * @param customInclude Function to programmatically include a test. * If this function returns true, a test will immediately run. Otherwise, * `testFilters` is used for fine-grained filtering. * @@ -124,7 +124,7 @@ export function setupTestFilters( * Filter method that returns boolean, if a given test should run or be * ignored based on its name. The exclude list has priority over the * include list. Thus, if a test matches both the exclude and the include - * list, it will be exluded. + * list, it will be excluded. */ // tslint:disable-next-line: no-any const specFilter = (spec: any) => { diff --git a/tfjs-core/src/ops/depthwise_conv2d_test.ts b/tfjs-core/src/ops/depthwise_conv2d_test.ts index e6ccc7b0e2a..83e1b34f775 100644 --- a/tfjs-core/src/ops/depthwise_conv2d_test.ts +++ b/tfjs-core/src/ops/depthwise_conv2d_test.ts @@ -1214,7 +1214,7 @@ describeWithFlags('depthwiseConv2d gradients', ALL_ENVS, () => { [[[1, 1], [1, 1], [0, 0]], [[0, 1], [1, 1], [1, 1]]], [[[1, 0], [1, 1], [0, 0]], [[0, 1], [1, 0], [0, 0]]] ]); - // result of convolution operatoin + // result of convolution operation result = tf.tensor4d([ [ [[2, 8, 8, 7, 2, 2], [6, 3, 1, 1, 0, 0]], diff --git a/tfjs-core/src/ops/ragged_tensor_to_tensor.ts b/tfjs-core/src/ops/ragged_tensor_to_tensor.ts index 2485a16a335..e3c85df50e4 100644 --- a/tfjs-core/src/ops/ragged_tensor_to_tensor.ts +++ b/tfjs-core/src/ops/ragged_tensor_to_tensor.ts @@ -70,7 +70,7 @@ import {op} from './operation'; * "ROW_SPLITS": the row_splits tensor from the ragged tensor. * "VALUE_ROWIDS": the value_rowids tensor from the ragged tensor. * "FIRST_DIM_SIZE": if value_rowids is used for the first dimension, then - * it is preceeded by "FIRST_DIM_SIZE". The tensors are in the order of + * it is preceded by "FIRST_DIM_SIZE". The tensors are in the order of * the dimensions. * @return A Tensor. Has the same type as values. * @doc {heading: 'Operations', subheading: 'Ragged'} diff --git a/tfjs-core/src/serialization.ts b/tfjs-core/src/serialization.ts index 621a9a63962..14d452b39e9 100644 --- a/tfjs-core/src/serialization.ts +++ b/tfjs-core/src/serialization.ts @@ -225,7 +225,7 @@ export class SerializationMap { * * @param cls The class to be registered. It must have a public static member * called `className` defined and the value must be a non-empty string. - * @param pkg The pakcage name that this class belongs to. This used to define + * @param pkg The package name that this class belongs to. This used to define * the key in GlobalCustomObject. If not defined, it defaults to `Custom`. * @param name The name that user specified. It defaults to the actual name of * the class as specified by its static `className` property. diff --git a/tfjs-core/src/tensor.ts b/tfjs-core/src/tensor.ts index 137d3b48705..9b37029807f 100644 --- a/tfjs-core/src/tensor.ts +++ b/tfjs-core/src/tensor.ts @@ -518,7 +518,7 @@ Object.defineProperty(Tensor, Symbol.hasInstance, { export function getGlobalTensorClass() { // Use getGlobal so that we can augment the Tensor class across package - // boundaries becase the node resolution alg may result in different modules + // boundaries because the node resolution alg may result in different modules // being returned for this file depending on the path they are loaded from. return getGlobal('Tensor', () => { return Tensor; From 33d939a55c22f7fe1eef3183f01d2a23d7e780da Mon Sep 17 00:00:00 2001 From: mattvr <4052466+mattvr@users.noreply.github.com> Date: Fri, 11 Oct 2024 12:50:26 -0700 Subject: [PATCH 05/17] webgpu: fix: conditionally call deprecated GPUAdapter.requestAdapterInfo (#8392) * fix: conditionally call deprecated GPUAdapter.requestAdapterInfo * Update tfjs-backend-webgpu/src/base.ts Co-authored-by: Kenta Moriuchi * fix: update webgpu types --------- Co-authored-by: Kenta Moriuchi --- package.json | 2 +- tfjs-backend-webgpu/src/base.ts | 8 +++++++- yarn.lock | 8 ++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 16b119a9cfb..2588de32671 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "@types/semver": "^7.3.9", "@types/shelljs": "^0.8.7", "@types/dom-webcodecs": "0.1.4", - "@webgpu/types": "0.1.38", + "@webgpu/types": "0.1.48", "ajv": "~6.12.3", "argparse": "^1.0.10", "chalk": "~2.4.2", diff --git a/tfjs-backend-webgpu/src/base.ts b/tfjs-backend-webgpu/src/base.ts index 1de43149b07..cf3ac665e24 100644 --- a/tfjs-backend-webgpu/src/base.ts +++ b/tfjs-backend-webgpu/src/base.ts @@ -57,7 +57,13 @@ if (isWebGPUSupported()) { }; const device: GPUDevice = await adapter.requestDevice(deviceDescriptor); - const adapterInfo = await adapter.requestAdapterInfo(); + const adapterInfo = + 'info' in adapter + ? adapter.info + : 'requestAdapterInfo' in adapter + // tslint:disable-next-line:no-any + ? await (adapter as any).requestAdapterInfo() + : undefined; return new WebGPUBackend(device, adapterInfo); }, 3 /*priority*/); } diff --git a/yarn.lock b/yarn.lock index 69db9f15c68..1f1f69345a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -513,10 +513,10 @@ resolved "https://registry.yarnpkg.com/@verdaccio/ui-theme/-/ui-theme-6.0.0-6-next.23.tgz#268da5091e1e9264fe87b8b94c0ac596e9e54879" integrity sha512-GXpEPdZJm6o+2VAxzUsKaiDriS+5enqr7Gjrb2Bttcd+IkOuC8lDsoFHxIv0ib4JudZJ/aKsRYL3TN2AetPFjw== -"@webgpu/types@0.1.38": - version "0.1.38" - resolved "https://registry.npmjs.org/@webgpu/types/-/types-0.1.38.tgz#6fda4b410edc753d3213c648320ebcf319669020" - integrity sha512-7LrhVKz2PRh+DD7+S+PVaFd5HxaWQvoMqBbsV9fNJO1pjUs1P8bM2vQVNfk+3URTqbuTI7gkXi0rfsN0IadoBA== +"@webgpu/types@0.1.48": + version "0.1.48" + resolved "https://registry.yarnpkg.com/@webgpu/types/-/types-0.1.48.tgz#8ab741852283118bd633345c20e218faa7211e9c" + integrity sha512-e3zmDEPih4Rle+JrP5cT8nCCtDizoUpEaN72OuD1clbhXGERtn0wwuMdxOrBymu3kMLWKDd8hd+ERhSheLuLTg== "@xmldom/xmldom@^0.7.3": version "0.7.5" From cb6206c291dcd07428b558bea4ab03cc21f6114b Mon Sep 17 00:00:00 2001 From: Matthew Soulanille Date: Thu, 5 Dec 2024 10:31:40 -0800 Subject: [PATCH 06/17] Update README.md (#8464) --- tfjs-converter/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfjs-converter/README.md b/tfjs-converter/README.md index 3a8821cb978..07587a9867f 100644 --- a/tfjs-converter/README.md +++ b/tfjs-converter/README.md @@ -319,7 +319,7 @@ jax_conversion.convert_jax( ``` See -[here](https://github.com/google/jax/tree/main/jax/experimental/jax2tf#shape-polymorphic-conversion) +[here](https://github.com/jax-ml/jax/tree/main/jax/experimental/jax2tf#shape-polymorphic-conversion) for more details on the exact syntax for this argument. When converting JAX models, you can also pass any [options that From 2644bd0d6cea677f80e44ed4a44bea5e04aabeb3 Mon Sep 17 00:00:00 2001 From: Matthew Soulanille Date: Wed, 18 Dec 2024 17:57:50 -0800 Subject: [PATCH 07/17] [WebGPU] Make dataToGPU upload to GPU if data is on CPU (#8483) --- tfjs-backend-webgpu/src/backend_webgpu.ts | 9 ++++++--- tfjs-backend-webgpu/src/backend_webgpu_test.ts | 12 ++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/tfjs-backend-webgpu/src/backend_webgpu.ts b/tfjs-backend-webgpu/src/backend_webgpu.ts index ceae66c513a..ebf517fa550 100644 --- a/tfjs-backend-webgpu/src/backend_webgpu.ts +++ b/tfjs-backend-webgpu/src/backend_webgpu.ts @@ -594,8 +594,9 @@ export class WebGPUBackend extends KernelBackend { * @param dataId The source tensor. */ override readToGPU(dataId: DataId): GPUData { - const srcTensorData = this.tensorMap.get(dataId); - const {values, dtype, shape, resource} = srcTensorData; + let srcTensorData = this.tensorMap.get(dataId); + const {values, dtype, shape} = srcTensorData; + let resource = srcTensorData.resource; if (dtype === 'complex64') { throw new Error('Does not support reading buffer for complex64 dtype.'); @@ -603,7 +604,9 @@ export class WebGPUBackend extends KernelBackend { if (resource == null) { if (values != null) { - throw new Error('Data is not on GPU but on CPU.'); + this.uploadToGPU(dataId); + srcTensorData = this.tensorMap.get(dataId); + resource = srcTensorData.resource; } else { throw new Error('There is no data on GPU or CPU.'); } diff --git a/tfjs-backend-webgpu/src/backend_webgpu_test.ts b/tfjs-backend-webgpu/src/backend_webgpu_test.ts index ed8149f409a..5e06905d7c8 100644 --- a/tfjs-backend-webgpu/src/backend_webgpu_test.ts +++ b/tfjs-backend-webgpu/src/backend_webgpu_test.ts @@ -200,6 +200,18 @@ describeWebGPU('backend webgpu', () => { await c3.data(); tf.env().set('WEBGPU_DEFERRED_SUBMIT_BATCH_SIZE', savedFlag); }); + + it('dataToGPU uploads to GPU if the tensor is on CPU', async () => { + const webGPUBackend = (tf.backend() as WebGPUBackend); + const data = [1,2,3,4,5]; + const tensor = tf.tensor1d(data); + const res = tensor.dataToGPU(); + expect(res.buffer).toBeDefined(); + const resData = await webGPUBackend.getBufferData(res.buffer); + const values = tf.util.convertBackendValuesAndArrayBuffer( + resData, res.tensorRef.dtype); + expectArraysEqual(values, data); + }); }); describeWebGPU('backendWebGPU', () => { From 78345c5f33736f5f090fd6719d3b336c85f6ed62 Mon Sep 17 00:00:00 2001 From: Matthew Soulanille Date: Wed, 23 Apr 2025 10:55:01 -0700 Subject: [PATCH 08/17] Move PR Continuous Integration to Github Actions (#8534) Move GCP presubmits to Github actions. This allows us to run WebGL / WebGPU tests, since Github Actions have a MacOS runner with a GPU. This should unblock several PRs. --- .github/workflows/tfjs-ci.yml | 54 +++++++++++++++++++ BUILD.bazel | 21 ++++++-- package.json | 4 ++ tfjs-backend-webgl/BUILD.bazel | 30 +++++++++++ tfjs-backend-webgpu/BUILD.bazel | 7 +++ tfjs-backend-webgpu/src/setup_test.ts | 13 +++++ tfjs-layers/BUILD.bazel | 10 ++++ .../layers/nlp/multihead_attention_test.ts | 1 + tools/karma_template.conf.js | 25 +++++++-- 9 files changed, 157 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/tfjs-ci.yml diff --git a/.github/workflows/tfjs-ci.yml b/.github/workflows/tfjs-ci.yml new file mode 100644 index 00000000000..9004ae9a8f0 --- /dev/null +++ b/.github/workflows/tfjs-ci.yml @@ -0,0 +1,54 @@ +name: TFJS Continuous Integration + +on: + push: + branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + workflow_dispatch: + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: bazel-contrib/setup-bazel@0.14.0 + with: + # Avoid downloading Bazel every time. + bazelisk-cache: true + # Store build cache per workflow. + disk-cache: ${{ github.workflow }}-cpu + # Share repository cache between workflows. + repository-cache: true + - uses: actions/checkout@v4 + - name: Test TFJS CPU + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: 'npm' + - run: npm i -g yarn + - run: yarn install + - run: yarn test-cpu + + test-gpu-mac: + runs-on: macos-latest-xlarge # consumer gpu + steps: + - uses: bazel-contrib/setup-bazel@0.14.0 + with: + # Avoid downloading Bazel every time. + bazelisk-cache: true + # Store build cache per workflow. + disk-cache: ${{ github.workflow }}-gpu-mac + # Share repository cache between workflows. + repository-cache: true + - uses: actions/checkout@v4 + - name: Test TFJS GPU + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: 'npm' + - run: npm i -g yarn + - run: yarn install + - run: yarn test-gpu diff --git a/BUILD.bazel b/BUILD.bazel index d1c21570ac0..3f7ea2fa80a 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -49,16 +49,31 @@ headless_flag( ) test_suite( - name = "tests", + name = "tests_cpu", tests = [ "//tfjs-backend-cpu:tests", "//tfjs-backend-wasm:tests", - "//tfjs-backend-webgl:tests", "//tfjs-converter:tests", "//tfjs-core:tests", "//tfjs-data:tests", - "//tfjs-layers:tests", "//tfjs-tfdf:tests", "//tfjs-tflite:tests", ], ) + +test_suite( + name = "tests_gpu", + tests = [ + "//tfjs-backend-webgl:tests", + "//tfjs-backend-webgpu:tests", + "//tfjs-layers:tests", + ], +) + +test_suite( + name = "tests", + tests = [ + ":tests_cpu", + ":tests_gpu", + ], +) diff --git a/package.json b/package.json index 2588de32671..8ad2b115358 100644 --- a/package.json +++ b/package.json @@ -80,6 +80,10 @@ "scripts": { "lint": "tslint -p tsconfig_tslint.json", "test": "bazel test //:tests", + "test-cpu": "bazel test --test_output=all //:tests_cpu", + "test-gpu": "bazel test --test_output=all //:tests_gpu", + "test-non-bazel": "cd link-package && yarn build-deps-for --all", + "build": "cd link-package && yarn build", "test-packages-ci": "yarn generate-cloudbuild-for-packages && ./scripts/run-build.sh", "nightly-cloudbuild": "NIGHTLY=true yarn generate-cloudbuild-for-packages && gcloud builds submit . --config=cloudbuild_generated.yml --substitutions=_NIGHTLY=true", "generate-cloudbuild-for-packages": "ts-node -s ./scripts/generate_cloudbuild_for_packages.ts", diff --git a/tfjs-backend-webgl/BUILD.bazel b/tfjs-backend-webgl/BUILD.bazel index cbe8e8c9d26..ba970c7af63 100644 --- a/tfjs-backend-webgl/BUILD.bazel +++ b/tfjs-backend-webgl/BUILD.bazel @@ -116,6 +116,11 @@ tfjs_web_test( "bs_chrome_mac", "bs_android_10", ], + local_browser = select({ + "@bazel_tools//src/conditions:linux_x86_64": "chrome_webgpu_linux", + "@bazel_tools//src/conditions:windows": "chrome_webgpu", + "//conditions:default": "chrome_webgpu", + }), static_files = STATIC_FILES, ) @@ -137,6 +142,11 @@ tfjs_web_test( "bs_safari_mac", "bs_ios_12", ], + local_browser = select({ + "@bazel_tools//src/conditions:linux_x86_64": "chrome_webgpu_linux", + "@bazel_tools//src/conditions:windows": "chrome_webgpu", + "//conditions:default": "chrome_webgpu", + }), static_files = STATIC_FILES, ) @@ -156,6 +166,11 @@ tfjs_web_test( ], headless = False, presubmit_browsers = [], # Only run in nightly + local_browser = select({ + "@bazel_tools//src/conditions:linux_x86_64": "chrome_webgpu_linux", + "@bazel_tools//src/conditions:windows": "chrome_webgpu", + "//conditions:default": "chrome_webgpu", + }), static_files = STATIC_FILES, ) @@ -175,6 +190,11 @@ tfjs_web_test( ], headless = False, presubmit_browsers = [], # Only run in nightly + local_browser = select({ + "@bazel_tools//src/conditions:linux_x86_64": "chrome_webgpu_linux", + "@bazel_tools//src/conditions:windows": "chrome_webgpu", + "//conditions:default": "chrome_webgpu", + }), static_files = STATIC_FILES, ) @@ -194,6 +214,11 @@ tfjs_web_test( ], headless = False, presubmit_browsers = [], # Only run in nightly + local_browser = select({ + "@bazel_tools//src/conditions:linux_x86_64": "chrome_webgpu_linux", + "@bazel_tools//src/conditions:windows": "chrome_webgpu", + "//conditions:default": "chrome_webgpu", + }), static_files = STATIC_FILES, ) @@ -213,6 +238,11 @@ tfjs_web_test( ], headless = False, presubmit_browsers = [], # Only run in nightly + local_browser = select({ + "@bazel_tools//src/conditions:linux_x86_64": "chrome_webgpu_linux", + "@bazel_tools//src/conditions:windows": "chrome_webgpu", + "//conditions:default": "chrome_webgpu", + }), static_files = STATIC_FILES, ) diff --git a/tfjs-backend-webgpu/BUILD.bazel b/tfjs-backend-webgpu/BUILD.bazel index b38b970e8e2..dac1208c937 100644 --- a/tfjs-backend-webgpu/BUILD.bazel +++ b/tfjs-backend-webgpu/BUILD.bazel @@ -116,3 +116,10 @@ tfjs_web_test( }), static_files = STATIC_FILES, ) + +test_suite( + name = "tests", + tests = [ + ":tfjs-backend-webgpu_test", + ], +) diff --git a/tfjs-backend-webgpu/src/setup_test.ts b/tfjs-backend-webgpu/src/setup_test.ts index f881a35fbae..71e13b5491c 100644 --- a/tfjs-backend-webgpu/src/setup_test.ts +++ b/tfjs-backend-webgpu/src/setup_test.ts @@ -33,6 +33,12 @@ const TEST_FILTERS: TestFilter[] = [ 'gradient', // gradient function not found. ] }, + { + startsWith: 'pow', + excludes: [ + 'int32' // MacOS precision issue + ], + }, { startsWith: 'exp ', excludes: [ @@ -62,6 +68,13 @@ const TEST_FILTERS: TestFilter[] = [ excludes: [ 'gradients', // Failing on MacOS 'gradient with clones', // Failing on MacOS + 'propagates NaNs', // Failing on MacOS + ], + }, + { + startsWith: 'sin ', + excludes: [ + 'propagates NaNs', // Failing on MacOS ], }, { diff --git a/tfjs-layers/BUILD.bazel b/tfjs-layers/BUILD.bazel index 88f1358c418..76223bdafad 100644 --- a/tfjs-layers/BUILD.bazel +++ b/tfjs-layers/BUILD.bazel @@ -59,6 +59,11 @@ tfjs_web_test( ], headless = False, seed = "12345", + local_browser = select({ + "@bazel_tools//src/conditions:linux_x86_64": "chrome_webgpu_linux", + "@bazel_tools//src/conditions:windows": "chrome_webgpu", + "//conditions:default": "chrome_webgpu", + }), static_files = [ # Listed here so sourcemaps are served "//tfjs-layers/src:tfjs-layers_test_bundle", @@ -79,6 +84,11 @@ tfjs_web_test( ], headless = False, seed = "12345", + local_browser = select({ + "@bazel_tools//src/conditions:linux_x86_64": "chrome_webgpu_linux", + "@bazel_tools//src/conditions:windows": "chrome_webgpu", + "//conditions:default": "chrome_webgpu", + }), static_files = [ # Listed here so sourcemaps are served "//tfjs-layers/src:tfjs-layers_test_bundle", diff --git a/tfjs-layers/src/layers/nlp/multihead_attention_test.ts b/tfjs-layers/src/layers/nlp/multihead_attention_test.ts index 1cc5d77f0e5..bdf0cbcee3a 100644 --- a/tfjs-layers/src/layers/nlp/multihead_attention_test.ts +++ b/tfjs-layers/src/layers/nlp/multihead_attention_test.ts @@ -117,6 +117,7 @@ describeMathCPUAndGPU('MultiHeadAttention', () => { */ function testMaskedAttention({testcaseName, useBias}: MaskedAttentionArgs) { it(`${testcaseName}`, () => { + pending('Temporarily disabled due to failing on Mac'); const testLayer = new MultiHeadAttention({ numHeads: 2, keyDim: 2, diff --git a/tools/karma_template.conf.js b/tools/karma_template.conf.js index 1e90d9bcba4..2e9b1af0ff7 100644 --- a/tools/karma_template.conf.js +++ b/tools/karma_template.conf.js @@ -37,6 +37,7 @@ const CUSTOM_LAUNCHERS = { os: 'OS X', os_version: 'High Sierra', flags: [ + '--use-mock-keychain', // For tfjs-data '--autoplay-policy=no-user-gesture-required', ], @@ -96,6 +97,7 @@ const CUSTOM_LAUNCHERS = { flags: [ '--enable-unsafe-webgpu', // Can be removed after WebGPU release '--use-webgpu-adapter=swiftshader', + '--use-mock-keychain', // https://github.com/tensorflow/tfjs/issues/7631 '--disable-vulkan-fallback-to-gl-for-testing', @@ -103,37 +105,50 @@ const CUSTOM_LAUNCHERS = { }, chrome_with_swift_shader: { base: CHROME, - flags: ['--blacklist-accelerated-compositing', '--blacklist-webgl'] + flags: [ + '--blacklist-accelerated-compositing', + '--blacklist-webgl', + '--use-mock-keychain', + ] }, chrome_autoplay: { base: CHROME, flags: [ '--autoplay-policy=no-user-gesture-required', '--no-sandbox', + '--use-mock-keychain', ], }, chrome_webgpu_linux: { - base: 'ChromeCanary', + base: 'ChromeHeadless', flags: [ '--enable-features=Vulkan', '--enable-unsafe-webgpu', '--disable-dawn-features=disallow_unsafe_apis', + '--use-mock-keychain', ] }, chrome_webgpu: { - base: 'ChromeCanary', + base: 'Chrome', flags: [ '--disable-dawn-features=disallow_unsafe_apis', '--no-sandbox', + '--use-mock-keychain', ] }, chrome_debugging: { base: 'Chrome', - flags: ['--remote-debugging-port=9333'], + flags: [ + '--remote-debugging-port=9333', + '--use-mock-keychain', + ], }, chrome_no_sandbox: { base: CHROME, - flags: ['--no-sandbox'], + flags: [ + '--no-sandbox', + '--use-mock-keychain', + ], } }; From 407c6e56b9c794be0051cdcf83dd0dfafdb09027 Mon Sep 17 00:00:00 2001 From: Matthew Soulanille Date: Wed, 23 Apr 2025 11:04:02 -0700 Subject: [PATCH 09/17] Fix wrong branch name in CI workflow --- .github/workflows/tfjs-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tfjs-ci.yml b/.github/workflows/tfjs-ci.yml index 9004ae9a8f0..435b9313755 100644 --- a/.github/workflows/tfjs-ci.yml +++ b/.github/workflows/tfjs-ci.yml @@ -2,9 +2,9 @@ name: TFJS Continuous Integration on: push: - branches: [ $default-branch ] + branches: [ "master" ] pull_request: - branches: [ $default-branch ] + branches: [ "master" ] workflow_dispatch: permissions: From f2e55729ba2a032855de52d81883eb3460d71d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rousset?= Date: Wed, 23 Apr 2025 20:30:04 +0200 Subject: [PATCH 10/17] [tfjs-node] replace deprecated utils (#8425) Co-authored-by: Matthew Soulanille --- tfjs-node/src/kernels/TopK.ts | 5 ++--- tfjs-node/src/nodejs_kernel_backend.ts | 9 ++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tfjs-node/src/kernels/TopK.ts b/tfjs-node/src/kernels/TopK.ts index 9b581ffbd40..9f77169e1f0 100644 --- a/tfjs-node/src/kernels/TopK.ts +++ b/tfjs-node/src/kernels/TopK.ts @@ -16,7 +16,6 @@ */ import {KernelConfig, scalar, TopK, TopKAttrs, TopKInputs} from '@tensorflow/tfjs'; -import {isNullOrUndefined} from 'util'; import {createTensorsTypeOpAttr, NodeJSKernelBackend} from '../nodejs_kernel_backend'; @@ -28,8 +27,8 @@ export const topKConfig: KernelConfig = { const backend = args.backend as NodeJSKernelBackend; const {k, sorted} = args.attrs as unknown as TopKAttrs; - const kCount = isNullOrUndefined(k) ? 1 : k; - const isSorted = isNullOrUndefined(sorted) ? true : sorted; + const kCount = k ?? 1; + const isSorted = sorted ?? true; const opAttrs = [ {name: 'sorted', type: backend.binding.TF_ATTR_BOOL, value: isSorted}, createTensorsTypeOpAttr('T', x.dtype), diff --git a/tfjs-node/src/nodejs_kernel_backend.ts b/tfjs-node/src/nodejs_kernel_backend.ts index a399d31bfa0..a192f313854 100644 --- a/tfjs-node/src/nodejs_kernel_backend.ts +++ b/tfjs-node/src/nodejs_kernel_backend.ts @@ -17,7 +17,6 @@ import * as tf from '@tensorflow/tfjs'; import {backend_util, BackendTimingInfo, DataId, DataType, KernelBackend, ModelTensorInfo, Rank, Scalar, scalar, ScalarLike, Tensor, Tensor1D, Tensor2D, Tensor3D, Tensor4D, TensorInfo, tidy, util} from '@tensorflow/tfjs'; -import {isArray, isNullOrUndefined} from 'util'; import {encodeInt32ArrayAsInt64, Int64Scalar} from './int64_tensors'; import {TensorMetadata, TFEOpAttr, TFJSBinding} from './tfjs_binding'; @@ -740,7 +739,7 @@ export function getTFDType(dataType: tf.DataType): number { export function createTensorsTypeOpAttr( attrName: string, tensorsOrDtype: tf.Tensor|tf.Tensor[]|tf.DataType): TFEOpAttr { - if (isNullOrUndefined(tensorsOrDtype)) { + if (tensorsOrDtype === null || tensorsOrDtype === undefined) { throw new Error('Invalid input tensors value.'); } return { @@ -757,7 +756,7 @@ export function createTensorsTypeOpAttr( export function createOpAttr( attrName: string, tensorsOrDtype: tf.Tensor|tf.Tensor[]|tf.DataType, value: ScalarLike): TFEOpAttr { - if (isNullOrUndefined(tensorsOrDtype)) { + if (tensorsOrDtype === null || tensorsOrDtype === undefined) { throw new Error('Invalid input tensors value.'); } return {name: attrName, type: nodeBackend().binding.TF_BOOL, value}; @@ -765,10 +764,10 @@ export function createOpAttr( /** Returns the dtype number for a single or list of input Tensors. */ function getTFDTypeForInputs(tensors: tf.Tensor|tf.Tensor[]): number { - if (isNullOrUndefined(tensors)) { + if (tensors === null || tensors === undefined) { throw new Error('Invalid input tensors value.'); } - if (isArray(tensors)) { + if (Array.isArray(tensors)) { for (let i = 0; i < tensors.length; i++) { return getTFDType(tensors[i].dtype); } From 29c5db378f0ae2265a9d8dfba6ffbef58d2abfab Mon Sep 17 00:00:00 2001 From: Shivam Mishra <124146945+shmishra99@users.noreply.github.com> Date: Thu, 24 Apr 2025 00:05:13 +0530 Subject: [PATCH 11/17] Remove --no-site-packages flag from virtualenv command and update the supported python version. (#8551) * Remove --no-site-packages flag from virtualenv. * change python version to least supported version. --------- Co-authored-by: Matthew Soulanille --- tfjs-converter/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tfjs-converter/README.md b/tfjs-converter/README.md index 07587a9867f..8aee3079133 100644 --- a/tfjs-converter/README.md +++ b/tfjs-converter/README.md @@ -26,14 +26,14 @@ __0. Please make sure that you run in a Docker container or a virtual environmen __Note__: *Check that [`tf-nightly-cpu-2.0-preview`](https://pypi.org/project/tf-nightly-cpu-2.0-preview/#files) is available for your platform.* -Most of the times, this means that you have to use Python 3.6.8 in your local -environment. To force Python 3.6.8 in your local project, you can install +Most of the times, this means that you have to use Python 3.7.10 in your local +environment. To force Python 3.7.10 in your local project, you can install [`pyenv`](https://github.com/pyenv/pyenv) and proceed as follows in the target directory: ```bash -pyenv install 3.6.8 -pyenv local 3.6.8 +pyenv install 3.7.10 +pyenv local 3.7.10 ``` Now, you can @@ -41,7 +41,7 @@ Now, you can a `venv` virtual environment in your current folder: ```bash -virtualenv --no-site-packages venv +virtualenv venv . venv/bin/activate ``` From 8c087a4cb3a7030fef12e7f1661862fb78aef863 Mon Sep 17 00:00:00 2001 From: Matthew Soulanille Date: Wed, 23 Apr 2025 11:44:17 -0700 Subject: [PATCH 12/17] [WebGPU] Access properties with `.prop` instead of `['prop']` (#8503) Fixes a bug with closure compiler property renaming. --- tfjs-backend-webgpu/src/backend_webgpu.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tfjs-backend-webgpu/src/backend_webgpu.ts b/tfjs-backend-webgpu/src/backend_webgpu.ts index ebf517fa550..6afb6824edd 100644 --- a/tfjs-backend-webgpu/src/backend_webgpu.ts +++ b/tfjs-backend-webgpu/src/backend_webgpu.ts @@ -73,8 +73,8 @@ const reshapeDispatch = program: webgpu_program.WebGPUProgram): [number, number, number] => { const MAX_COMPUTE_PER_DIMENSION_DISPATCH_SIZE = device.limits.maxComputeWorkgroupsPerDimension; - const layout = program['dispatchLayout']; - const dispatch = program['dispatch']; + const layout = program.dispatchLayout; + const dispatch = program.dispatch; if (dispatch.every((d) => d <= MAX_COMPUTE_PER_DIMENSION_DISPATCH_SIZE)) { return dispatch; } @@ -694,8 +694,8 @@ export class WebGPUBackend extends KernelBackend { }; const kernelMs = await Promise.all(flattenedActiveTimerQueries); - res['kernelMs'] = util.sum(kernelMs); - res['getExtraProfileInfo'] = () => + res.kernelMs = util.sum(kernelMs); + res.getExtraProfileInfo = () => kernelMs.map((d, i) => ({name: flattenedActiveTimerNames[i], ms: d})) .map(d => `${d.name}: ${d.ms}`) .join(', '); From a83539db79fc6900ef7c5af829ac0c5dbb9ca80b Mon Sep 17 00:00:00 2001 From: croraf Date: Wed, 23 Apr 2025 20:54:17 +0200 Subject: [PATCH 13/17] Fix description for util_base.ts `assert` function (#8270) Co-authored-by: Ping Yu <4018+pyu10055@users.noreply.github.com> --- tfjs-core/src/util_base.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tfjs-core/src/util_base.ts b/tfjs-core/src/util_base.ts index cb7498b21df..45033f75e97 100644 --- a/tfjs-core/src/util_base.ts +++ b/tfjs-core/src/util_base.ts @@ -139,7 +139,7 @@ export function distSquared(a: FlatVector, b: FlatVector): number { * * ```js * const x = 2; - * tf.util.assert(x === 2, 'x is not 2'); + * tf.util.assert(x === 2, () => 'x is not 2'); * ``` * * @param expr The expression to assert (as a boolean). From dc7261728faffaf48c2c5dd3fafed2b9361b8932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rousset?= Date: Wed, 23 Apr 2025 20:59:09 +0200 Subject: [PATCH 14/17] [tfjs-core] do not hang on invalid browser files (#8517) `tf.io.browserFiles` doesn't fail when loading invalid files. or rather, it fails, but never rejects the promise, making the `IOHandler.load` hang forever. wrapping the `JSON.parse` call in a try/catch and rejecting accordingly did the trick. and a small test to try it out. note: `FileReader.readAsText()` is a callback way to go around reading files. the promise-based `Blob.text()` would make `BrowserFile.load` simpler and safer (but felt ouf-of-scope here). --- tfjs-core/src/io/browser_files.ts | 11 +++++++++-- tfjs-core/src/io/browser_files_test.ts | 8 ++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/tfjs-core/src/io/browser_files.ts b/tfjs-core/src/io/browser_files.ts index 816e00a0820..7079ab3f55f 100644 --- a/tfjs-core/src/io/browser_files.ts +++ b/tfjs-core/src/io/browser_files.ts @@ -139,8 +139,15 @@ class BrowserFiles implements IOHandler { return new Promise((resolve, reject) => { const jsonReader = new FileReader(); jsonReader.onload = (event: Event) => { - // tslint:disable-next-line:no-any - const modelJSON = JSON.parse((event.target as any).result) as ModelJSON; + let modelJSON: ModelJSON; + try { + // tslint:disable-next-line:no-any + modelJSON = JSON.parse((event.target as any).result); + } catch { + reject(new Error(`Failed to parse file ${ + this.jsonFile.name}: {e.message}`)); + return; + } const modelTopology = modelJSON.modelTopology; if (modelTopology == null) { diff --git a/tfjs-core/src/io/browser_files_test.ts b/tfjs-core/src/io/browser_files_test.ts index f48d15ebdeb..1a480cad627 100644 --- a/tfjs-core/src/io/browser_files_test.ts +++ b/tfjs-core/src/io/browser_files_test.ts @@ -677,4 +677,12 @@ describeWithFlags('browserFiles', BROWSER_ENVS, () => { expect(() => tf.io.browserFiles(null)).toThrowError(/at least 1 file/); expect(() => tf.io.browserFiles([])).toThrowError(/at least 1 file/); }); + + it('Invalid JSON leads to Error', async () => { + const file = new File(['invalid'], 'model.json', { + type: 'application/json', + }); + const filesHandler = tf.io.browserFiles([file]); + await expectAsync(filesHandler.load()).toBeRejectedWithError(/parse file/); + }); }); From 51577688f1c695db72ed75176875a2d3c8c3ea29 Mon Sep 17 00:00:00 2001 From: Matthew Soulanille Date: Mon, 28 Apr 2025 09:07:00 -0700 Subject: [PATCH 15/17] Move nightly publishing tests and release branch tests to github actions (#8555) [Example nightly release and publish test](https://github.com/mattsoulanille/tfjs/actions/runs/14672995746/job/41183624273) [Example release PR test](https://github.com/mattsoulanille/tfjs/actions/runs/14674243426/job/41187438555?pr=1) --- .bazelrc | 1 + .../tfjs-nightly-release-and-publish-test.yml | 52 ++++ .../tfjs-release-branch-publish-test.yml | 42 +++ e2e/custom_module/blazeface/yarn.lock | 8 +- e2e/custom_module/dense_model/yarn.lock | 8 +- .../universal_sentence_encoder/yarn.lock | 8 +- e2e/karma.conf.js | 3 +- .../tfjs-core-cpu/karma.conf.js | 1 + e2e/script_tag_tests/tfjs/karma.conf.js | 1 + e2e/scripts/create-python-models.sh | 11 +- e2e/scripts/run-browserstack-tests.sh | 53 ---- e2e/scripts/run-custom-builds.sh | 14 +- e2e/scripts/setup-py-env.sh | 11 +- e2e/scripts/test-ci.sh | 21 +- e2e/webpack_test/yarn.lock | 8 +- e2e/yarn.lock | 70 ++--- scripts/publish-npm.ts | 3 +- tfjs-node/yarn.lock | 268 ++++++++++++++---- tfjs/yarn.lock | 159 ++++++++++- 19 files changed, 534 insertions(+), 208 deletions(-) create mode 100644 .github/workflows/tfjs-nightly-release-and-publish-test.yml create mode 100644 .github/workflows/tfjs-release-branch-publish-test.yml delete mode 100755 e2e/scripts/run-browserstack-tests.sh diff --git a/.bazelrc b/.bazelrc index 8da25af637e..49a44c6f8ef 100644 --- a/.bazelrc +++ b/.bazelrc @@ -46,6 +46,7 @@ build:rbe --config=remote # Config for Google Cloud continuous integration that uses default credentials. build:ci --config=bes + # This flag is needed to prevent the bazel cache from being invalidated when # running bazel via `yarn bazel`. # See https://github.com/angular/angular/issues/27514. diff --git a/.github/workflows/tfjs-nightly-release-and-publish-test.yml b/.github/workflows/tfjs-nightly-release-and-publish-test.yml new file mode 100644 index 00000000000..aae8c18e7db --- /dev/null +++ b/.github/workflows/tfjs-nightly-release-and-publish-test.yml @@ -0,0 +1,52 @@ +name: TFJS Nightly Release and Publish Test + +on: + schedule: + - cron: '0 5 * * *' # Runs daily at 5:00 AM UTC + workflow_dispatch: # Allows manual triggering + +permissions: + contents: read # Default permissions, adjust if the script needs to write to the repo + +jobs: + nightly_release_verification: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup Bazel + uses: bazel-contrib/setup-bazel@0.14.0 + with: + bazelisk-cache: true + disk-cache: ${{ github.workflow }}-nightly-release + repository-cache: true + + - name: Setup Node.js and Yarn + uses: actions/setup-node@v4 + with: + node-version: 20.x # Using a current LTS version of Node.js + cache: 'yarn' + + - name: Install Yarn globally (if not already cached by setup-node with yarn cache) + run: npm i -g yarn + + - name: Install top-level dependencies + run: yarn install --frozen-lockfile + + - name: Run Nightly Verdaccio Test Script + env: + RELEASE: 'true' # Set RELEASE to true as in the original config + run: | + set -eEuo pipefail + yarn release-tfjs --dry --guess-version release --use-local-changes --force + # The original script changes directory to a temporary location created by the release script. + # This assumes /tmp/ is accessible and the path structure is consistent. + # If release-e2e.sh is relative to the checkout root after the release script prep, adjust path. + if [ -d "/tmp/tfjs-release/tfjs/e2e/" ]; then + cd /tmp/tfjs-release/tfjs/e2e/ + bash scripts/release-e2e.sh + else + echo "Error: Expected directory /tmp/tfjs-release/tfjs/e2e/ not found after release script." + exit 1 + fi diff --git a/.github/workflows/tfjs-release-branch-publish-test.yml b/.github/workflows/tfjs-release-branch-publish-test.yml new file mode 100644 index 00000000000..df51fa4acca --- /dev/null +++ b/.github/workflows/tfjs-release-branch-publish-test.yml @@ -0,0 +1,42 @@ +name: TFJS Release Branch Publish Test + +on: + pull_request: + branches: + - 'tfjs_**' # Matches branches starting with tfjs_, e.g., tfjs_1.2.3, tfjs_core + workflow_dispatch: # Allows manual triggering + +permissions: + contents: read # Default permissions, adjust if the script needs to write to the repo + +jobs: + release_e2e_test: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup Bazel + uses: bazel-contrib/setup-bazel@0.14.0 + with: + bazelisk-cache: true + disk-cache: ${{ github.workflow }}-release-e2e + repository-cache: true + + - name: Setup Node.js and Yarn + uses: actions/setup-node@v4 + with: + node-version: 20.x + cache: 'yarn' # Changed from 'npm' in example to 'yarn' as primary tool here + + - name: Install Yarn globally (if not already cached by setup-node with yarn cache) + run: npm i -g yarn + + - name: Install top-level dependencies + run: yarn install --frozen-lockfile + + - name: Run E2E Release Script + working-directory: ./e2e # Sets the directory for this step + env: + RELEASE: 'true' # Set RELEASE to true as requested + run: bash ./scripts/release-e2e.sh diff --git a/e2e/custom_module/blazeface/yarn.lock b/e2e/custom_module/blazeface/yarn.lock index 1173fe11b1b..f9a1dafc188 100644 --- a/e2e/custom_module/blazeface/yarn.lock +++ b/e2e/custom_module/blazeface/yarn.lock @@ -366,10 +366,10 @@ "@webassemblyjs/ast" "1.11.1" "@xtuc/long" "4.2.2" -"@webgpu/types@0.1.30": - version "0.1.30" - resolved "https://registry.yarnpkg.com/@webgpu/types/-/types-0.1.30.tgz#b6406dc4a1c1e0d469028ceb30ddffbbd2fa706c" - integrity sha512-9AXJSmL3MzY8ZL//JjudA//q+2kBRGhLBFpkdGksWIuxrMy81nFrCzj2Am+mbh8WoU6rXmv7cY5E3rdlyru2Qg== +"@webgpu/types@0.1.38": + version "0.1.38" + resolved "https://registry.yarnpkg.com/@webgpu/types/-/types-0.1.38.tgz#6fda4b410edc753d3213c648320ebcf319669020" + integrity sha512-7LrhVKz2PRh+DD7+S+PVaFd5HxaWQvoMqBbsV9fNJO1pjUs1P8bM2vQVNfk+3URTqbuTI7gkXi0rfsN0IadoBA== "@webpack-cli/info@^1.1.0": version "1.1.0" diff --git a/e2e/custom_module/dense_model/yarn.lock b/e2e/custom_module/dense_model/yarn.lock index ca6d72ed3b9..2602123d929 100644 --- a/e2e/custom_module/dense_model/yarn.lock +++ b/e2e/custom_module/dense_model/yarn.lock @@ -305,10 +305,10 @@ "@webassemblyjs/ast" "1.11.1" "@xtuc/long" "4.2.2" -"@webgpu/types@0.1.30": - version "0.1.30" - resolved "https://registry.yarnpkg.com/@webgpu/types/-/types-0.1.30.tgz#b6406dc4a1c1e0d469028ceb30ddffbbd2fa706c" - integrity sha512-9AXJSmL3MzY8ZL//JjudA//q+2kBRGhLBFpkdGksWIuxrMy81nFrCzj2Am+mbh8WoU6rXmv7cY5E3rdlyru2Qg== +"@webgpu/types@0.1.38": + version "0.1.38" + resolved "https://registry.yarnpkg.com/@webgpu/types/-/types-0.1.38.tgz#6fda4b410edc753d3213c648320ebcf319669020" + integrity sha512-7LrhVKz2PRh+DD7+S+PVaFd5HxaWQvoMqBbsV9fNJO1pjUs1P8bM2vQVNfk+3URTqbuTI7gkXi0rfsN0IadoBA== "@webpack-cli/configtest@^1.1.1": version "1.1.1" diff --git a/e2e/custom_module/universal_sentence_encoder/yarn.lock b/e2e/custom_module/universal_sentence_encoder/yarn.lock index e94b3433ee3..a91e1e05c1d 100644 --- a/e2e/custom_module/universal_sentence_encoder/yarn.lock +++ b/e2e/custom_module/universal_sentence_encoder/yarn.lock @@ -305,10 +305,10 @@ "@webassemblyjs/ast" "1.11.1" "@xtuc/long" "4.2.2" -"@webgpu/types@0.1.30": - version "0.1.30" - resolved "https://registry.yarnpkg.com/@webgpu/types/-/types-0.1.30.tgz#b6406dc4a1c1e0d469028ceb30ddffbbd2fa706c" - integrity sha512-9AXJSmL3MzY8ZL//JjudA//q+2kBRGhLBFpkdGksWIuxrMy81nFrCzj2Am+mbh8WoU6rXmv7cY5E3rdlyru2Qg== +"@webgpu/types@0.1.38": + version "0.1.38" + resolved "https://registry.yarnpkg.com/@webgpu/types/-/types-0.1.38.tgz#6fda4b410edc753d3213c648320ebcf319669020" + integrity sha512-7LrhVKz2PRh+DD7+S+PVaFd5HxaWQvoMqBbsV9fNJO1pjUs1P8bM2vQVNfk+3URTqbuTI7gkXi0rfsN0IadoBA== "@webpack-cli/configtest@^1.1.1": version "1.1.1" diff --git a/e2e/karma.conf.js b/e2e/karma.conf.js index e478c88bf17..8236e0c1e31 100644 --- a/e2e/karma.conf.js +++ b/e2e/karma.conf.js @@ -40,6 +40,7 @@ if (coverageEnabled) { } const devConfig = { + singleRun: true, frameworks: ['jasmine', 'karma-typescript'], files: [ {pattern: './node_modules/@babel/polyfill/dist/polyfill.js'}, @@ -148,7 +149,7 @@ module.exports = function(config) { 'spec', 'jasmine-order', ], - browsers: ['Chrome'], + browsers: ['ChromeHeadless'], browserStack: { username: process.env.BROWSERSTACK_USERNAME, accessKey: process.env.BROWSERSTACK_KEY, diff --git a/e2e/script_tag_tests/tfjs-core-cpu/karma.conf.js b/e2e/script_tag_tests/tfjs-core-cpu/karma.conf.js index 55bc70140d8..0a77208312e 100644 --- a/e2e/script_tag_tests/tfjs-core-cpu/karma.conf.js +++ b/e2e/script_tag_tests/tfjs-core-cpu/karma.conf.js @@ -28,6 +28,7 @@ module.exports = function(config) { const devConfig = { frameworks: ['jasmine'], + singleRun: true, files: [ { pattern: coreBundlePath, diff --git a/e2e/script_tag_tests/tfjs/karma.conf.js b/e2e/script_tag_tests/tfjs/karma.conf.js index 46146a61e25..e42e326f703 100644 --- a/e2e/script_tag_tests/tfjs/karma.conf.js +++ b/e2e/script_tag_tests/tfjs/karma.conf.js @@ -24,6 +24,7 @@ module.exports = function(config) { const devConfig = { frameworks: ['jasmine'], + singleRun: true, files: [ { pattern: tfjsBundlePath, diff --git a/e2e/scripts/create-python-models.sh b/e2e/scripts/create-python-models.sh index 80170bfa4a3..d5b6d0b94c9 100755 --- a/e2e/scripts/create-python-models.sh +++ b/e2e/scripts/create-python-models.sh @@ -23,9 +23,14 @@ cd integration_tests source ../scripts/setup-py-env.sh --dev -parallel ::: 'echo "Load equivalent keras models and generate outputs." && python create_save_predict.py' \ - 'echo "Create saved models and convert." && python convert_predict.py' \ - 'echo "Convert model with user defined metadata." && python metadata.py' +echo "Load equivalent keras models and generate outputs." +python create_save_predict.py + +echo "Create saved models and convert." +python convert_predict.py + +echo "Convert model with user defined metadata." +python metadata.py # Cleanup python env. source ../scripts/cleanup-py-env.sh diff --git a/e2e/scripts/run-browserstack-tests.sh b/e2e/scripts/run-browserstack-tests.sh deleted file mode 100755 index 8822421b5e9..00000000000 --- a/e2e/scripts/run-browserstack-tests.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env bash -# Copyright 2023 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# ============================================================================== - -# This script runs browserstack tests on all configured browsers. It requires -# the TAGS variable to be set in the environment. - -set -e - -# Smoke and regression tests run in PR and nightly builds. -TAGS="#SMOKE,#REGRESSION" -TAGS_WITH_GOLDEN="$TAGS,#GOLDEN" - -# Test macOS with smoke/regression tests. -# Skip golden tests because they time out on browserstack (they work locally). -# TODO(mattSoulanille): Make golden tests work on BrowserStack Mac. -COMMANDS+=("yarn run-browserstack --browsers=bs_chrome_mac --tags '$TAGS'") - -# Test windows 10 with smoke/regression/golden tests. -COMMANDS+=("yarn run-browserstack --browsers=win_10_chrome --tags '$TAGS_WITH_GOLDEN'") - -# Test script tag bundles -COMMANDS+=("karma start ./script_tag_tests/tfjs/karma.conf.js --browserstack --browsers=bs_chrome_mac --testBundle tf.min.js") - -# Additional tests to run in nightly only. -if [[ "$NIGHTLY" = true || "$RELEASE" = true ]]; then - COMMANDS+=( - "yarn run-browserstack --browsers=bs_ios_12 --tags '$TAGS' --testEnv webgl --flags '{\"\\"\"WEBGL_VERSION\"\\"\": 1, \"\\"\"WEBGL_CPU_FORWARD\"\\"\": false, \"\\"\"WEBGL_SIZE_UPLOAD_UNIFORM\"\\"\": 0}'" - "yarn run-browserstack --browsers=bs_safari_mac --tags '$TAGS' --testEnv webgl --flags '{\"\\"\"WEBGL_VERSION\"\\"\": 1, \"\\"\"WEBGL_CPU_FORWARD\"\\"\": false, \"\\"\"WEBGL_SIZE_UPLOAD_UNIFORM\"\\"\": 0}'" - "yarn run-browserstack --browsers=bs_firefox_mac --tags '$TAGS'" - "yarn run-browserstack --browsers=bs_android_10 --tags '$TAGS'" - # Test script tag bundles - "karma start ./script_tag_tests/tfjs-core-cpu/karma.conf.js --browserstack --browsers=bs_chrome_mac" - ) -fi - -for command in "${COMMANDS[@]}"; do - TO_RUN+=("node ../scripts/run_flaky.js \"$command\"") -done - -parallel ::: "${TO_RUN[@]}" diff --git a/e2e/scripts/run-custom-builds.sh b/e2e/scripts/run-custom-builds.sh index 033340dec5e..4b699a40651 100755 --- a/e2e/scripts/run-custom-builds.sh +++ b/e2e/scripts/run-custom-builds.sh @@ -15,12 +15,20 @@ # limitations under the License. # ============================================================================== +set -e + # Start in scripts/ even if run from root directory cd "$(dirname "$0")" + # Go to e2e root cd .. -parallel ::: 'cd custom_module/blazeface && ./build.sh' \ - 'cd custom_module/dense_model && ./build.sh' \ - 'cd custom_module/universal_sentence_encoder && ./build.sh' +echo "Building blazeface..." +(cd custom_module/blazeface && ./build.sh) + +echo "Building dense_model..." +(cd custom_module/dense_model && ./build.sh) + +echo "Building universal_sentence_encoder..." +(cd custom_module/universal_sentence_encoder && ./build.sh) diff --git a/e2e/scripts/setup-py-env.sh b/e2e/scripts/setup-py-env.sh index 1897f678bfc..cdb29d4ec11 100755 --- a/e2e/scripts/setup-py-env.sh +++ b/e2e/scripts/setup-py-env.sh @@ -37,16 +37,13 @@ if [[ -z "${DEV_VERSION}" ]]; then fi VENV_DIR="$(mktemp -d)_venv" -echo "Creating virtualenv at ${VENV_DIR} ..." -PLATFORM="$(python -m platform)" -if [[ $PLATFORM =~ "Windows" ]] -then - python -m virtualenv -p python3 "${VENV_DIR}" - source "${VENV_DIR}/Scripts/activate" +echo "Creating venv at ${VENV_DIR} ..." +if ! which virtualenv > /dev/null 2>&1; then + python3 -m venv "${VENV_DIR}" else virtualenv -p python3 "${VENV_DIR}" - source "${VENV_DIR}/bin/activate" fi +source "${VENV_DIR}/bin/activate" # Install python packages. if [[ "${DEV_VERSION}" == "stable" ]]; then diff --git a/e2e/scripts/test-ci.sh b/e2e/scripts/test-ci.sh index f622ef357f2..c9f7302f4d4 100755 --- a/e2e/scripts/test-ci.sh +++ b/e2e/scripts/test-ci.sh @@ -14,12 +14,21 @@ # limitations under the License. # ============================================================================== -set -e +set -euxo pipefail # Generate custom bundle files and model files for tests -parallel ::: ./scripts/run-custom-builds.sh \ - ./scripts/create-python-models.sh +./scripts/run-custom-builds.sh +./scripts/create-python-models.sh -# Run browserstack tests (and webpack test) -parallel ::: ./scripts/run-browserstack-tests.sh \ - "cd webpack_test && yarn --mutex network && yarn build" +TAGS='#SMOKE,#REGRESSION,#GOLDEN' + +# Test with smoke/regression tests. +yarn karma start --single-run --tags "${TAGS}" + +# Test script tag bundles +# Temporarily disabled +# yarn karma start --single-run ./script_tag_tests/tfjs/karma.conf.js --testBundle tf.min.js --tags "${TAGS}" +# yarn karma start --single-run ./script_tag_tests/tfjs-core-cpu/karma.conf.js --tags "${TAGS}" + +# Test webpack +(cd webpack_test && yarn --mutex network && yarn build) diff --git a/e2e/webpack_test/yarn.lock b/e2e/webpack_test/yarn.lock index b3b39b2d928..9d61ed02fb0 100644 --- a/e2e/webpack_test/yarn.lock +++ b/e2e/webpack_test/yarn.lock @@ -222,10 +222,10 @@ "@webassemblyjs/ast" "1.11.1" "@xtuc/long" "4.2.2" -"@webgpu/types@0.1.30": - version "0.1.30" - resolved "https://registry.yarnpkg.com/@webgpu/types/-/types-0.1.30.tgz#b6406dc4a1c1e0d469028ceb30ddffbbd2fa706c" - integrity sha512-9AXJSmL3MzY8ZL//JjudA//q+2kBRGhLBFpkdGksWIuxrMy81nFrCzj2Am+mbh8WoU6rXmv7cY5E3rdlyru2Qg== +"@webgpu/types@0.1.38": + version "0.1.38" + resolved "https://registry.yarnpkg.com/@webgpu/types/-/types-0.1.38.tgz#6fda4b410edc753d3213c648320ebcf319669020" + integrity sha512-7LrhVKz2PRh+DD7+S+PVaFd5HxaWQvoMqBbsV9fNJO1pjUs1P8bM2vQVNfk+3URTqbuTI7gkXi0rfsN0IadoBA== "@webpack-cli/configtest@^1.0.4": version "1.0.4" diff --git a/e2e/yarn.lock b/e2e/yarn.lock index d7f3dd60e88..4ab949e7b0b 100644 --- a/e2e/yarn.lock +++ b/e2e/yarn.lock @@ -1101,10 +1101,10 @@ resolved "https://registry.yarnpkg.com/@types/seedrandom/-/seedrandom-2.4.30.tgz#d2efe425869b84163c2d56e779dddadb9372cbfa" integrity sha512-AnxLHewubLVzoF/A4qdxBGHCKifw8cY32iro3DQX9TPcetE95zBeVt3jnsvtvAUf1vwzMfwzp4t/L2yqPlnjkQ== -"@webgpu/types@0.1.30": - version "0.1.30" - resolved "https://registry.yarnpkg.com/@webgpu/types/-/types-0.1.30.tgz#b6406dc4a1c1e0d469028ceb30ddffbbd2fa706c" - integrity sha512-9AXJSmL3MzY8ZL//JjudA//q+2kBRGhLBFpkdGksWIuxrMy81nFrCzj2Am+mbh8WoU6rXmv7cY5E3rdlyru2Qg== +"@webgpu/types@0.1.38": + version "0.1.38" + resolved "https://registry.yarnpkg.com/@webgpu/types/-/types-0.1.38.tgz#6fda4b410edc753d3213c648320ebcf319669020" + integrity sha512-7LrhVKz2PRh+DD7+S+PVaFd5HxaWQvoMqBbsV9fNJO1pjUs1P8bM2vQVNfk+3URTqbuTI7gkXi0rfsN0IadoBA== abbrev@1: version "1.1.1" @@ -1565,11 +1565,6 @@ chokidar@^3.5.1: optionalDependencies: fsevents "~2.3.2" -chownr@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" - integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== - chownr@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" @@ -2236,13 +2231,6 @@ fs-extra@^10.0.1: jsonfile "^6.0.1" universalify "^2.0.0" -fs-minipass@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" - integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== - dependencies: - minipass "^2.6.0" - fs-minipass@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" @@ -3100,14 +3088,6 @@ minimist@^1.2.6: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== -minipass@^2.6.0, minipass@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" - integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - minipass@^3.0.0: version "3.1.6" resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.6.tgz#3b8150aa688a711a1521af5e8779c1d3bb4f45ee" @@ -3115,12 +3095,10 @@ minipass@^3.0.0: dependencies: yallist "^4.0.0" -minizlib@^1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" - integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== - dependencies: - minipass "^2.9.0" +minipass@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" + integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== minizlib@^2.1.1: version "2.1.2" @@ -3608,7 +3586,7 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -3881,19 +3859,6 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -tar@^4.4.6: - version "4.4.19" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3" - integrity sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA== - dependencies: - chownr "^1.1.4" - fs-minipass "^1.2.7" - minipass "^2.9.0" - minizlib "^1.3.3" - mkdirp "^0.5.5" - safe-buffer "^5.2.1" - yallist "^3.1.1" - tar@^6.1.11: version "6.1.11" resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" @@ -3906,6 +3871,18 @@ tar@^6.1.11: mkdirp "^1.0.3" yallist "^4.0.0" +tar@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a" + integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A== + dependencies: + chownr "^2.0.0" + fs-minipass "^2.0.0" + minipass "^5.0.0" + minizlib "^2.1.1" + mkdirp "^1.0.3" + yallist "^4.0.0" + temp-fs@^0.9.9: version "0.9.9" resolved "https://registry.yarnpkg.com/temp-fs/-/temp-fs-0.9.9.tgz#8071730437870720e9431532fe2814364f8803d7" @@ -4292,11 +4269,6 @@ y18n@^5.0.5: resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== -yallist@^3.0.0, yallist@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - yallist@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" diff --git a/scripts/publish-npm.ts b/scripts/publish-npm.ts index 4aaa696c5a8..2db56e2a11a 100755 --- a/scripts/publish-npm.ts +++ b/scripts/publish-npm.ts @@ -350,7 +350,8 @@ async function main() { const bazelArgs = ['bazel', 'build'] if (args.ci) { - bazelArgs.push('--config=ci'); + // Disabled for now since github actions don't have a gcp key currently. + // bazelArgs.push('--config=ci'); } // Use child_process.spawnSync to show bazel build progress. const result = child_process.spawnSync('yarn', diff --git a/tfjs-node/yarn.lock b/tfjs-node/yarn.lock index 27383fd7b84..41fca7003e9 100644 --- a/tfjs-node/yarn.lock +++ b/tfjs-node/yarn.lock @@ -227,6 +227,9 @@ semver "^7.3.5" tar "^6.1.11" +"@tensorflow/tfjs-backend-cpu@link:../link-package/node_modules/@tensorflow/link-package/node_modules/@tensorflow/tfjs-backend-cpu": + version "0.0.0" + "@tensorflow/tfjs-backend-cpu@link:../link-package/node_modules/@tensorflow/tfjs-backend-cpu": version "0.0.0" uid "" @@ -268,11 +271,24 @@ resolved "https://registry.yarnpkg.com/@types/jasmine/-/jasmine-4.0.3.tgz#097ce710d70eb7f3662e96c1f75824dd22c27d5c" integrity sha512-Opp1LvvEuZdk8fSSvchK2mZwhVrsNT0JgJE9Di6MjnaIpmEXM8TLCPPrVtNTYh8+5MPdY8j9bAHMu2SSfwpZJg== +"@types/long@^4.0.1": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" + integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== + "@types/minimatch@*": version "3.0.4" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21" integrity sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA== +"@types/node-fetch@^2.1.2": + version "2.6.12" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.12.tgz#8ab5c3ef8330f13100a7479e2cd56d3386830a03" + integrity sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA== + dependencies: + "@types/node" "*" + form-data "^4.0.0" + "@types/node@*": version "14.14.36" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.36.tgz#5637905dbb15c30a33a3c65b9ef7c20e3c85ebad" @@ -283,6 +299,16 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.55.tgz#a147f282edec679b894d4694edb5abeb595fecbd" integrity sha512-koZJ89uLZufDvToeWO5BrC4CR4OUfHnUz2qoPs/daQH6qq3IN62QFxCTZ+bKaCE0xaoCAJYE4AXre8AbghCrhg== +"@types/offscreencanvas@~2019.3.0": + version "2019.3.0" + resolved "https://registry.yarnpkg.com/@types/offscreencanvas/-/offscreencanvas-2019.3.0.tgz#3336428ec7e9180cf4566dfea5da04eb586a6553" + integrity sha512-esIJx9bQg+QYF0ra8GnvfianIY8qWB0GBx54PK5Eps6m+xTj86KLavHv6qDhzKcu5UUOgNfJ2pWaIIV7TRUd9Q== + +"@types/offscreencanvas@~2019.7.0": + version "2019.7.3" + resolved "https://registry.yarnpkg.com/@types/offscreencanvas/-/offscreencanvas-2019.7.3.tgz#90267db13f64d6e9ccb5ae3eac92786a7c77a516" + integrity sha512-ieXiYmgSRXUDeOntE1InxjWyvEelZGP63M+cGuquuRLuIKKT1osnkXjxev9B7d1nXSug5vpunx+gNlbVxMlC9A== + "@types/progress@^2.0.1": version "2.0.3" resolved "https://registry.yarnpkg.com/@types/progress/-/progress-2.0.3.tgz#7ccbd9c6d4d601319126c469e73b5bb90dfc8ccc" @@ -298,6 +324,11 @@ "@types/glob" "*" "@types/node" "*" +"@types/seedrandom@^2.4.28": + version "2.4.34" + resolved "https://registry.yarnpkg.com/@types/seedrandom/-/seedrandom-2.4.34.tgz#c725cd0fc0442e2d3d0e5913af005686ffb7eb99" + integrity sha512-ytDiArvrn/3Xk6/vtylys5tlY6eo7Ane0hvcx++TKo6RxQXuVfW0AF/oeWqAj9dN29SyhtawuXstgmPlwNcv/A== + "@types/yargs-parser@*": version "20.2.0" resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.0.tgz#dd3e6699ba3237f0348cd085e4698780204842f9" @@ -310,6 +341,11 @@ dependencies: "@types/yargs-parser" "*" +"@webgpu/types@0.1.38": + version "0.1.38" + resolved "https://registry.yarnpkg.com/@webgpu/types/-/types-0.1.38.tgz#6fda4b410edc753d3213c648320ebcf319669020" + integrity sha512-7LrhVKz2PRh+DD7+S+PVaFd5HxaWQvoMqBbsV9fNJO1pjUs1P8bM2vQVNfk+3URTqbuTI7gkXi0rfsN0IadoBA== + abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" @@ -403,6 +439,11 @@ async@^3.2.3: resolved "https://registry.yarnpkg.com/async/-/async-3.2.3.tgz#ac53dafd3f4720ee9e8a160628f18ea91df196c9" integrity sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g== +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + balanced-match@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" @@ -447,6 +488,14 @@ caching-transform@^4.0.0: package-hash "^4.0.0" write-file-atomic "^3.0.0" +call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz#4b5428c222be985d79c3d82657479dbe0b59b2d6" + integrity sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + camelcase@^5.0.0, camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" @@ -474,11 +523,6 @@ chalk@^4.1.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chownr@^1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b" - integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg== - chownr@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" @@ -545,6 +589,13 @@ color-support@^1.1.2: resolved "https://registry.yarnpkg.com/color-support/-/color-support-1.1.3.tgz#93834379a1cc9a0c61f82f52f0d04322251bd5a2" integrity sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg== +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + commander@^2.12.1: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" @@ -612,6 +663,11 @@ default-require-extensions@^3.0.0: dependencies: strip-bom "^4.0.0" +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + delegates@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a" @@ -632,6 +688,15 @@ diff@^4.0.1: resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== +dunder-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" + integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A== + dependencies: + call-bind-apply-helpers "^1.0.1" + es-errors "^1.3.0" + gopd "^1.2.0" + electron-to-chromium@^1.4.76: version "1.4.82" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.82.tgz#51e123ca434b1eba8c434ece2b54f095b304a651" @@ -642,6 +707,33 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +es-define-property@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" + integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + +es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" + integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== + dependencies: + es-errors "^1.3.0" + +es-set-tostringtag@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz#f31dbbe0c183b00a6d26eb6325c810c0fd18bd4d" + integrity sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA== + dependencies: + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + has-tostringtag "^1.0.2" + hasown "^2.0.2" + es6-error@^4.0.1: version "4.1.1" resolved "https://registry.yarnpkg.com/es6-error/-/es6-error-4.1.1.tgz#9e3af407459deed47e9a91f9b885a84eb05c561d" @@ -699,6 +791,16 @@ foreground-child@^2.0.0: cross-spawn "^7.0.0" signal-exit "^3.0.2" +form-data@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.2.tgz#35cabbdd30c3ce73deb2c42d3c8d3ed9ca51794c" + integrity sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + es-set-tostringtag "^2.1.0" + mime-types "^2.1.12" + fromentries@^1.2.0: version "1.3.2" resolved "https://registry.yarnpkg.com/fromentries/-/fromentries-1.3.2.tgz#e4bca6808816bf8f93b52750f1127f5a6fd86e3a" @@ -713,13 +815,6 @@ fs-extra@^8.0.1: jsonfile "^4.0.0" universalify "^0.1.0" -fs-minipass@^1.2.7: - version "1.2.7" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7" - integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA== - dependencies: - minipass "^2.6.0" - fs-minipass@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" @@ -737,6 +832,11 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + gauge@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/gauge/-/gauge-3.0.2.tgz#03bf4441c044383908bcfa0656ad91803259b395" @@ -762,11 +862,35 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== +get-intrinsic@^1.2.6: + version "1.3.0" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" + integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== + dependencies: + call-bind-apply-helpers "^1.0.2" + es-define-property "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.1.1" + function-bind "^1.1.2" + get-proto "^1.0.1" + gopd "^1.2.0" + has-symbols "^1.1.0" + hasown "^2.0.2" + math-intrinsics "^1.1.0" + get-package-type@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== +get-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" + integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== + dependencies: + dunder-proto "^1.0.1" + es-object-atoms "^1.0.0" + glob@^7.0.0, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: version "7.1.6" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" @@ -789,6 +913,11 @@ google-protobuf@^3.9.2: resolved "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.15.6.tgz#2048055828530993a51df4d4ca2c08322fc1ec7c" integrity sha512-p65NyhIZFHFUxbIPOm6cygg2rCjK+2uDCxruOG3RaWKM9R4rBGX0STmlJoSOhoyAG8Fha7U8FP4pQomAV1JXsA== +gopd@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" + integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== + graceful-fs@^4.1.15, graceful-fs@^4.1.6, graceful-fs@^4.2.0: version "4.2.6" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.6.tgz#ff040b2b0853b23c3d31027523706f1885d76bee" @@ -804,6 +933,18 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +has-symbols@^1.0.3, has-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" + integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== + +has-tostringtag@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" + integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== + dependencies: + has-symbols "^1.0.3" + has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" @@ -824,6 +965,13 @@ hasha@^5.0.0: is-stream "^2.0.0" type-fest "^0.8.0" +hasown@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + dependencies: + function-bind "^1.1.2" + html-escaper@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" @@ -1038,6 +1186,11 @@ lodash@^4.17.19: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== +long@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" + integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== + lru-cache@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" @@ -1057,6 +1210,23 @@ make-error@^1.1.1: resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== +math-intrinsics@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" + integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + minimatch@^3.0.4: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -1064,19 +1234,11 @@ minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" -minimist@^1.2.5, minimist@^1.2.6: +minimist@^1.2.5: version "1.2.6" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== -minipass@^2.6.0, minipass@^2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6" - integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg== - dependencies: - safe-buffer "^5.1.2" - yallist "^3.0.0" - minipass@^3.0.0: version "3.1.3" resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.3.tgz#7d42ff1f39635482e15f9cdb53184deebd5815fd" @@ -1084,12 +1246,10 @@ minipass@^3.0.0: dependencies: yallist "^4.0.0" -minizlib@^1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d" - integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q== - dependencies: - minipass "^2.9.0" +minipass@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" + integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== minizlib@^2.1.1: version "2.1.2" @@ -1106,13 +1266,6 @@ mkdirp@^0.5.3: dependencies: minimist "^1.2.5" -mkdirp@^0.5.5: - version "0.5.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" - integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== - dependencies: - minimist "^1.2.6" - mkdirp@^1.0.3: version "1.0.4" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" @@ -1373,16 +1526,21 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" -safe-buffer@^5.1.2, safe-buffer@^5.2.1, safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== +safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +seedrandom@^3.0.5: + version "3.0.5" + resolved "https://registry.yarnpkg.com/seedrandom/-/seedrandom-3.0.5.tgz#54edc85c95222525b0c7a6f6b3543d8e0b3aa0a7" + integrity sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg== + semver@^5.3.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" @@ -1475,7 +1633,7 @@ string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.0" -string_decoder@^1.1.1: +string_decoder@^1.1.1, string_decoder@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e" integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== @@ -1515,19 +1673,6 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -tar@^4.4.6: - version "4.4.19" - resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3" - integrity sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA== - dependencies: - chownr "^1.1.4" - fs-minipass "^1.2.7" - minipass "^2.9.0" - minizlib "^1.3.3" - mkdirp "^0.5.5" - safe-buffer "^5.2.1" - yallist "^3.1.1" - tar@^6.1.11: version "6.1.11" resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" @@ -1540,6 +1685,18 @@ tar@^6.1.11: mkdirp "^1.0.3" yallist "^4.0.0" +tar@^6.2.1: + version "6.2.1" + resolved "https://registry.yarnpkg.com/tar/-/tar-6.2.1.tgz#717549c541bc3c2af15751bea94b1dd068d4b03a" + integrity sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A== + dependencies: + chownr "^2.0.0" + fs-minipass "^2.0.0" + minipass "^5.0.0" + minizlib "^2.1.1" + mkdirp "^1.0.3" + yallist "^4.0.0" + test-exclude@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" @@ -1734,11 +1891,6 @@ yalc@~1.0.0-pre.50: npm-packlist "^1.4.1" yargs "^16.1.1" -yallist@^3.0.0, yallist@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" - integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== - yallist@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" diff --git a/tfjs/yarn.lock b/tfjs/yarn.lock index 5dbc13b3f00..d64914b66c1 100644 --- a/tfjs/yarn.lock +++ b/tfjs/yarn.lock @@ -1976,6 +1976,14 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21" integrity sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA== +"@types/node-fetch@^2.1.2": + version "2.6.12" + resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.12.tgz#8ab5c3ef8330f13100a7479e2cd56d3386830a03" + integrity sha512-8nneRWKCg3rMtF69nLQJnOYUcbafYeFSjqkw3jCRLsqkWFlHaoQrr5mXmofFGOx3DKn7UfmBMyov8ySvLRVldA== + dependencies: + "@types/node" "*" + form-data "^4.0.0" + "@types/node@*", "@types/node@>=10.0.0": version "18.11.9" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4" @@ -2026,10 +2034,10 @@ dependencies: "@types/yargs-parser" "*" -"@webgpu/types@0.1.30": - version "0.1.30" - resolved "https://registry.yarnpkg.com/@webgpu/types/-/types-0.1.30.tgz#b6406dc4a1c1e0d469028ceb30ddffbbd2fa706c" - integrity sha512-9AXJSmL3MzY8ZL//JjudA//q+2kBRGhLBFpkdGksWIuxrMy81nFrCzj2Am+mbh8WoU6rXmv7cY5E3rdlyru2Qg== +"@webgpu/types@0.1.38": + version "0.1.38" + resolved "https://registry.yarnpkg.com/@webgpu/types/-/types-0.1.38.tgz#6fda4b410edc753d3213c648320ebcf319669020" + integrity sha512-7LrhVKz2PRh+DD7+S+PVaFd5HxaWQvoMqBbsV9fNJO1pjUs1P8bM2vQVNfk+3URTqbuTI7gkXi0rfsN0IadoBA== accepts@~1.3.4: version "1.3.8" @@ -2145,6 +2153,11 @@ async@^3.0.1: resolved "https://registry.yarnpkg.com/async/-/async-3.2.0.tgz#b3a2685c5ebb641d3de02d161002c60fc9f85720" integrity sha512-TR2mEZFVOj2pLStYxLht7TyfuRzaydfpxr3k9RpHIzMgw7A64dzsdqCxH1WJyQdoe8T10nDXd9wnEigmiuHIZw== +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + available-typed-arrays@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.2.tgz#6b098ca9d8039079ee3f77f7b783c4480ba513f5" @@ -2433,6 +2446,14 @@ bytes@3.1.0: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== +call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz#4b5428c222be985d79c3d82657479dbe0b59b2d6" + integrity sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ== + dependencies: + es-errors "^1.3.0" + function-bind "^1.1.2" + call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" @@ -2573,6 +2594,13 @@ combine-source-map@^0.8.0: lodash.memoize "~3.0.3" source-map "~0.5.3" +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + commander@^2.12.1, commander@^2.20.0: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" @@ -2782,6 +2810,11 @@ define-properties@^1.1.3: dependencies: object-keys "^1.0.12" +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + depd@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" @@ -2839,6 +2872,15 @@ domain-browser@^4.16.0: resolved "https://registry.yarnpkg.com/domain-browser/-/domain-browser-4.19.0.tgz#1093e17c0a17dbd521182fe90d49ac1370054af1" integrity sha512-fRA+BaAWOR/yr/t7T9E9GJztHPeFjj8U35ajyAjCDtAAnTn1Rc1f6W6VGPJrO1tkQv9zWu+JRof7z6oQtiYVFQ== +dunder-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/dunder-proto/-/dunder-proto-1.0.1.tgz#d7ae667e1dc83482f8b70fd0f6eefc50da30f58a" + integrity sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A== + dependencies: + call-bind-apply-helpers "^1.0.1" + es-errors "^1.3.0" + gopd "^1.2.0" + duplexer@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6" @@ -2937,6 +2979,33 @@ es-abstract@^1.18.0-next.1, es-abstract@^1.18.0-next.2: string.prototype.trimstart "^1.0.4" unbox-primitive "^1.0.0" +es-define-property@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/es-define-property/-/es-define-property-1.0.1.tgz#983eb2f9a6724e9303f61addf011c72e09e0b0fa" + integrity sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g== + +es-errors@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" + integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== + +es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" + integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== + dependencies: + es-errors "^1.3.0" + +es-set-tostringtag@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz#f31dbbe0c183b00a6d26eb6325c810c0fd18bd4d" + integrity sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA== + dependencies: + es-errors "^1.3.0" + get-intrinsic "^1.2.6" + has-tostringtag "^1.0.2" + hasown "^2.0.2" + es-to-primitive@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" @@ -3064,6 +3133,16 @@ foreach@^2.0.5: resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" integrity sha1-C+4AUBiusmDQo6865ljdATbsG5k= +form-data@^4.0.0: + version "4.0.2" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.2.tgz#35cabbdd30c3ce73deb2c42d3c8d3ed9ca51794c" + integrity sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + es-set-tostringtag "^2.1.0" + mime-types "^2.1.12" + from@~0: version "0.1.7" resolved "https://registry.yarnpkg.com/from/-/from-0.1.7.tgz#83c60afc58b9c56997007ed1a768b3ab303a44fe" @@ -3109,6 +3188,11 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function-bind@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.2.tgz#2c02d864d97f3ea6c8830c464cbd11ab6eab7a1c" + integrity sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA== + gensync@^1.0.0-beta.2: version "1.0.0-beta.2" resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" @@ -3128,6 +3212,30 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: has "^1.0.3" has-symbols "^1.0.1" +get-intrinsic@^1.2.6: + version "1.3.0" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" + integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== + dependencies: + call-bind-apply-helpers "^1.0.2" + es-define-property "^1.0.1" + es-errors "^1.3.0" + es-object-atoms "^1.1.1" + function-bind "^1.1.2" + get-proto "^1.0.1" + gopd "^1.2.0" + has-symbols "^1.1.0" + hasown "^2.0.2" + math-intrinsics "^1.1.0" + +get-proto@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-proto/-/get-proto-1.0.1.tgz#150b3f2743869ef3e851ec0c49d15b1d14d00ee1" + integrity sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g== + dependencies: + dunder-proto "^1.0.1" + es-object-atoms "^1.0.0" + glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" @@ -3175,6 +3283,11 @@ globals@^11.1.0: resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== +gopd@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/gopd/-/gopd-1.2.0.tgz#89f56b8217bdbc8802bd299df6d7f1081d7e51a1" + integrity sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg== + graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.6: version "4.2.9" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" @@ -3207,6 +3320,18 @@ has-symbols@^1.0.1, has-symbols@^1.0.2: resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.2.tgz#165d3070c00309752a1236a479331e3ac56f1423" integrity sha512-chXa79rL/UC2KlX17jo3vRGz0azaWEx5tGqZg5pO3NUyEJVB17dMruQlzCCOfUvElghKcm5194+BCRvi2Rv/Gw== +has-symbols@^1.0.3, has-symbols@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.1.0.tgz#fc9c6a783a084951d0b971fe1018de813707a338" + integrity sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ== + +has-tostringtag@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz#2cdc42d40bef2e5b4eeab7c01a73c54ce7ab5abc" + integrity sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw== + dependencies: + has-symbols "^1.0.3" + has@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" @@ -3231,6 +3356,13 @@ hash.js@^1.0.0, hash.js@^1.0.3: inherits "^2.0.3" minimalistic-assert "^1.0.1" +hasown@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + dependencies: + function-bind "^1.1.2" + hmac-drbg@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" @@ -3851,6 +3983,11 @@ map-stream@~0.1.0: resolved "https://registry.yarnpkg.com/map-stream/-/map-stream-0.1.0.tgz#e56aa94c4c8055a16404a0674b78f215f7c8e194" integrity sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ= +math-intrinsics@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz#a0dd74be81e2aa5c2f27e65ce283605ee4e2b7f9" + integrity sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g== + md5.js@^1.3.4: version "1.3.5" resolved "https://registry.yarnpkg.com/md5.js/-/md5.js-1.3.5.tgz#b5d07b8e3216e3e27cd728d72f70d1e6a342005f" @@ -3893,6 +4030,13 @@ mime-db@1.52.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== +mime-types@^2.1.12, mime-types@~2.1.34: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + mime-types@~2.1.24: version "2.1.34" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" @@ -3900,13 +4044,6 @@ mime-types@~2.1.24: dependencies: mime-db "1.51.0" -mime-types@~2.1.34: - version "2.1.35" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" - integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== - dependencies: - mime-db "1.52.0" - mime@^2.5.2: version "2.6.0" resolved "https://registry.yarnpkg.com/mime/-/mime-2.6.0.tgz#a2a682a95cd4d0cb1d6257e28f83da7e35800367" From 0ef019b66dafe955dceaf00cf622358bd30c91ec Mon Sep 17 00:00:00 2001 From: gaikwadrahul8 <115997457+gaikwadrahul8@users.noreply.github.com> Date: Fri, 30 May 2025 04:09:13 +0530 Subject: [PATCH 16/17] Add NAPI-v9 support to tfjs-node-gpu package (#8547) * Add NAPI-v9 support to tfjs-node-gpu package * Update napi version to 9 for tfjs-node --- tfjs-node-gpu/package.json | 3 ++- tfjs-node/package.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tfjs-node-gpu/package.json b/tfjs-node-gpu/package.json index e1773f308c4..ba5dd8275b1 100644 --- a/tfjs-node-gpu/package.json +++ b/tfjs-node-gpu/package.json @@ -83,7 +83,8 @@ 5, 6, 7, - 8 + 8, + 9 ] } } diff --git a/tfjs-node/package.json b/tfjs-node/package.json index 46d0c99e09a..de8c0a2fa39 100644 --- a/tfjs-node/package.json +++ b/tfjs-node/package.json @@ -81,7 +81,8 @@ 5, 6, 7, - 8 + 8, + 9 ] } } From 0fc04d958ea592f3b8db79a8b3b497b5c8904097 Mon Sep 17 00:00:00 2001 From: Matthew Soulanille Date: Fri, 6 Jun 2025 13:55:10 -0700 Subject: [PATCH 17/17] Remove hub from tests (#8563) --- .../python/test_nightly_pip_package.py | 21 -------- tfjs-converter/python/test_pip_package.py | 49 ------------------- tfjs-converter/yarn.lock | 40 +++++++++++++-- 3 files changed, 36 insertions(+), 74 deletions(-) diff --git a/tfjs-converter/python/test_nightly_pip_package.py b/tfjs-converter/python/test_nightly_pip_package.py index bfe64678e09..1d55d3bc72f 100644 --- a/tfjs-converter/python/test_nightly_pip_package.py +++ b/tfjs-converter/python/test_nightly_pip_package.py @@ -47,27 +47,6 @@ def tearDown(self): shutil.rmtree(self._tmp_dir) super(APIAndShellTest, self).tearDown() - def testConvertTfHubMobileNetV2ToTfjsGraphModel(self): - # 1. Convert tfhub mobilenet v2 module. - tfhub_url = ( - 'https://tfhub.dev/google/imagenet/mobilenet_v2_100_224' - '/classification/3' - ) - graph_model_output_dir = os.path.join(self._tmp_dir, 'tfjs_graph') - process = subprocess.Popen([ - 'tensorflowjs_converter', '--input_format', 'tf_hub', - tfhub_url, graph_model_output_dir - ]) - process.communicate() - self.assertEqual(0, process.returncode) - - # 2. Check the files that belong to the conversion result. - files = glob.glob(os.path.join(graph_model_output_dir, '*')) - self.assertIn(os.path.join(graph_model_output_dir, 'model.json'), files) - weight_files = glob.glob( - os.path.join(graph_model_output_dir, 'group*.bin')) - self.assertEqual(len(weight_files), 4) - def testConvertMobileNetV2ModelToTfjsGraphModel(self): """create the keras mobilenet v2 model.""" # 1. Create a saved model from keras mobilenet v2. diff --git a/tfjs-converter/python/test_pip_package.py b/tfjs-converter/python/test_pip_package.py index bf76d0a14c3..42cdd12b1fe 100644 --- a/tfjs-converter/python/test_pip_package.py +++ b/tfjs-converter/python/test_pip_package.py @@ -36,7 +36,6 @@ from tensorflow.python.tools import freeze_graph from tensorflow.python.trackable import autotrackable from tensorflow.python.saved_model.save import save -import tensorflow_hub as hub import tensorflowjs as tfjs @@ -124,27 +123,6 @@ def _createTensorFlowSavedModel(save_path): save(root, save_path, to_save) - -def _create_hub_module(save_path): - """Create a TensorFlow Hub module for testing. - - Args: - save_path: The directory path in which to save the model. - """ - # Module function that doubles its input. - def double_module_fn(): - w = tf.Variable([2.0, 4.0]) - x = tf.compat.v1.placeholder(dtype=tf.float32) - hub.add_signature(inputs=x, outputs=x*w) - graph = tf.Graph() - with graph.as_default(): - spec = hub.create_module_spec(double_module_fn) - m = hub.Module(spec) - # Export the module. - with tf.compat.v1.Session(graph=graph) as sess: - sess.run(tf.compat.v1.global_variables_initializer()) - m.export(save_path, sess) - def _create_frozen_model(save_path): graph = tf.Graph() saved_model_dir = os.path.join(save_path) @@ -198,7 +176,6 @@ def setUpClass(cls): _createTensorFlowSavedModelV1('b', cls.tf_saved_model_v1_dir) _create_frozen_model(cls.tf_frozen_model_dir) cls.tf_hub_module_dir = os.path.join(cls.class_tmp_dir, 'tf_hub_module') - _create_hub_module(cls.tf_hub_module_dir) @classmethod def tearDownClass(cls): @@ -456,32 +433,6 @@ def testConvertTFSavedModelV1WithCommandLineWorks(self): # Check the content of the output directory. self.assertTrue(glob.glob(os.path.join(output_dir, 'group*-*'))) - - def testConvertTFHubModuleWithCommandLineWorks(self): - output_dir = os.path.join(self._tmp_dir) - process = subprocess.Popen([ - 'tensorflowjs_converter', '--input_format', 'tf_hub', - self.tf_hub_module_dir, output_dir - ]) - process.communicate() - self.assertEqual(0, process.returncode) - - weights = [{ - 'paths': ['group1-shard1of1.bin'], - 'weights': [{ - 'shape': [2], - 'name': 'module/Variable', - 'dtype': 'float32' - }] - }] - # Load the saved weights as a JSON string. - output_json = json.load( - open(os.path.join(output_dir, 'model.json'), 'rt')) - self.assertEqual(output_json['weightsManifest'], weights) - - # Check the content of the output directory. - self.assertTrue(glob.glob(os.path.join(output_dir, 'group*-*'))) - def testConvertTFSavedModelWithCommandLineWorks(self): output_dir = os.path.join(self._tmp_dir) process = subprocess.Popen([ diff --git a/tfjs-converter/yarn.lock b/tfjs-converter/yarn.lock index a0535ff08b1..a604d0acc5a 100644 --- a/tfjs-converter/yarn.lock +++ b/tfjs-converter/yarn.lock @@ -67,15 +67,22 @@ "@tensorflow/tfjs-backend-cpu@link:../link-package/node_modules/@tensorflow/tfjs-backend-cpu": version "0.0.0" + uid "" "@tensorflow/tfjs-core@link:../link-package/node_modules/@tensorflow/tfjs-core": version "0.0.0" + uid "" "@types/argparse@^1.0.38": version "1.0.38" resolved "https://registry.yarnpkg.com/@types/argparse/-/argparse-1.0.38.tgz#a81fd8606d481f873a3800c6ebae4f1d768a56a9" integrity sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA== +"@types/long@^4.0.1": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" + integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== + "@types/long@~3.0.32": version "3.0.32" resolved "https://registry.yarnpkg.com/@types/long/-/long-3.0.32.tgz#f4e5af31e9e9b196d8e5fca8a5e2e20aa3d60b69" @@ -93,6 +100,21 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.38.tgz#f8bb07c371ccb1903f3752872c89f44006132947" integrity sha512-5jY9RhV7c0Z4Jy09G+NIDTsCZ5G0L5n+Z+p+Y7t5VJHM30bgwzSjVtlcBxqAj+6L/swIlvtOSzr8rBk/aNyV2g== +"@types/offscreencanvas@~2019.7.0": + version "2019.7.3" + resolved "https://registry.yarnpkg.com/@types/offscreencanvas/-/offscreencanvas-2019.7.3.tgz#90267db13f64d6e9ccb5ae3eac92786a7c77a516" + integrity sha512-ieXiYmgSRXUDeOntE1InxjWyvEelZGP63M+cGuquuRLuIKKT1osnkXjxev9B7d1nXSug5vpunx+gNlbVxMlC9A== + +"@types/seedrandom@^2.4.28": + version "2.4.34" + resolved "https://registry.yarnpkg.com/@types/seedrandom/-/seedrandom-2.4.34.tgz#c725cd0fc0442e2d3d0e5913af005686ffb7eb99" + integrity sha512-ytDiArvrn/3Xk6/vtylys5tlY6eo7Ane0hvcx++TKo6RxQXuVfW0AF/oeWqAj9dN29SyhtawuXstgmPlwNcv/A== + +"@webgpu/types@0.1.38": + version "0.1.38" + resolved "https://registry.yarnpkg.com/@webgpu/types/-/types-0.1.38.tgz#6fda4b410edc753d3213c648320ebcf319669020" + integrity sha512-7LrhVKz2PRh+DD7+S+PVaFd5HxaWQvoMqBbsV9fNJO1pjUs1P8bM2vQVNfk+3URTqbuTI7gkXi0rfsN0IadoBA== + ansi-regex@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" @@ -277,6 +299,11 @@ jsonfile@^4.0.0: optionalDependencies: graceful-fs "^4.1.6" +long@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" + integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== + long@^5.0.0: version "5.2.3" resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" @@ -370,6 +397,11 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== +seedrandom@^3.0.5: + version "3.0.5" + resolved "https://registry.yarnpkg.com/seedrandom/-/seedrandom-3.0.5.tgz#54edc85c95222525b0c7a6f6b3543d8e0b3aa0a7" + integrity sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg== + source-map-support@^0.5.6: version "0.5.19" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61" @@ -427,10 +459,10 @@ ts-node@~8.8.2: source-map-support "^0.5.6" yn "3.1.1" -typescript@4.9.4: - version "4.9.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78" - integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg== +typescript@5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" + integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== universalify@^0.1.0: version "0.1.2"