Skip to content

Commit

Permalink
Merge branch 'master' into fixpf
Browse files Browse the repository at this point in the history
  • Loading branch information
pyu10055 committed Aug 28, 2023
2 parents dc43d18 + f4271a5 commit 0f4c3cd
Show file tree
Hide file tree
Showing 39 changed files with 794 additions and 132 deletions.
2 changes: 1 addition & 1 deletion e2e/benchmarks/browserstack-benchmark/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function getBrowserStackConfig() {
hostname: 'bs-local.com',
plugins: ['karma-jasmine', 'karma-browserstack-launcher'],
reporters: ['progress', 'BrowserStack'],
port: 9812,
port: 9200,
browserStack: {
username: process.env.BROWSERSTACK_USERNAME,
accessKey: process.env.BROWSERSTACK_ACCESS_KEY,
Expand Down
2 changes: 1 addition & 1 deletion e2e/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const browserstackConfig = {
// breaks WASM file serving.
// See https://www.browserstack.com/question/39574
singleRun: true,
port: 9876
port: 9200
};

const chromeWebgpuFlags = [
Expand Down
2 changes: 1 addition & 1 deletion e2e/script_tag_tests/tfjs-core-cpu/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = function(config) {
};

const browserstackConfig =
{...devConfig, hostname: 'bs-local.com', singleRun: true, port: 9811};
{...devConfig, hostname: 'bs-local.com', singleRun: true, port: 9200};

if (config.grep) {
args.push('--grep', config.grep);
Expand Down
2 changes: 1 addition & 1 deletion e2e/script_tag_tests/tfjs/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = function(config) {
};

const browserstackConfig =
{...devConfig, hostname: 'bs-local.com', singleRun: true, port: 9811};
{...devConfig, hostname: 'bs-local.com', singleRun: true, port: 9200};

if (config.grep) {
args.push('--grep', config.grep);
Expand Down
3 changes: 2 additions & 1 deletion e2e/scripts/run-browserstack-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ 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'"
# TODO(mattSoulanille): Re-enable firefox once it works on browserstack.
# "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"
Expand Down
10 changes: 5 additions & 5 deletions tfjs-automl/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module.exports = function(config) {
preprocessors: {'**/*.ts': ['karma-typescript']},
karmaTypescriptConfig,
reporters: ['progress', 'karma-typescript'],
port: 9866,
port: 9200,
colors: true,
browsers: ['Chrome'],
client: {jasmine: {random: false}, args: args},
Expand All @@ -82,7 +82,7 @@ module.exports = function(config) {
tunnelIdentifier:
`tfjs_automl_${Date.now()}_${Math.floor(Math.random() * 1000)}`
},
captureTimeout: 3e5,
captureTimeout: 10 * 1000,
reportSlowerThan: 500,
browserNoActivityTimeout: 3e5,
browserDisconnectTimeout: 3e5,
Expand All @@ -94,21 +94,21 @@ module.exports = function(config) {
browser: 'chrome',
browser_version: 'latest',
os: 'OS X',
os_version: 'High Sierra'
os_version: 'Ventura'
},
bs_firefox_mac: {
base: 'BrowserStack',
browser: 'firefox',
browser_version: 'latest',
os: 'OS X',
os_version: 'High Sierra'
os_version: 'Ventura'
},
bs_safari_mac: {
base: 'BrowserStack',
browser: 'safari',
browser_version: 'latest',
os: 'OS X',
os_version: 'Big Sur'
os_version: 'Ventura'
},
bs_ios_12: {
base: 'BrowserStack',
Expand Down
2 changes: 1 addition & 1 deletion tfjs-automl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"test-node": "tsc && ts-node --transpile-only --skip-ignore --project tsconfig.test.json src/test_node.ts",
"coverage": "KARMA_COVERAGE=1 karma start --singleRun",
"run-flaky": "node ../scripts/run_flaky.js",
"run-browserstack": "karma start --singleRun --reporters='dots,karma-typescript,BrowserStack' --hostname='bs-local.com'",
"run-browserstack": "karma start --singleRun --reporters='dots,karma-typescript,BrowserStack'",
"test-ci": "./scripts/test-ci.sh",
"build-npm": "./scripts/build-npm.sh"
},
Expand Down
6 changes: 4 additions & 2 deletions tfjs-automl/scripts/test-ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,7 @@ yarn run-flaky "yarn run-browserstack --browsers=bs_chrome_mac"
# Run the rest of the karma tests in parallel. These runs will reuse the
# already downloaded binary.
npm-run-all -p -c --aggregate-output \
"run-flaky \"yarn run-browserstack --browsers=bs_firefox_mac\"" \
"run-flaky \"yarn run-browserstack --browsers=bs_safari_mac --testEnv webgl1\""
"run-flaky \"yarn run-browserstack --browsers=bs_safari_mac --testEnv webgl1\""
# TODO(mattSoulanille): Re-enable firefox once it works on browserstack.
# "run-flaky \"yarn run-browserstack --browsers=bs_firefox_mac\"" \

3 changes: 2 additions & 1 deletion tfjs-backend-wasm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ tfjs_web_test(
],
browsers = [
"bs_chrome_mac",
"bs_firefox_mac",
# TODO(mattSoulanille): Re-enable firefox once it works on browserstack.
# "bs_firefox_mac",
"bs_safari_mac",
"bs_ios_12",
# TODO(mattsoulanille): Fix clipByValue on Android.
Expand Down
3 changes: 2 additions & 1 deletion tfjs-backend-webgl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ tfjs_web_test(
],
browsers = [
"bs_chrome_mac",
"bs_firefox_mac",
# TODO(mattSoulanille): Re-enable firefox once it works on browserstack.
# "bs_firefox_mac",
"bs_android_10",
"win_10_chrome",
],
Expand Down
30 changes: 0 additions & 30 deletions tfjs-backend-webgl/scripts/build-npm.sh

This file was deleted.

28 changes: 0 additions & 28 deletions tfjs-backend-webgl/scripts/test-ci.sh

This file was deleted.

6 changes: 0 additions & 6 deletions tfjs-backend-webgl/scripts/tsconfig.json

This file was deleted.

2 changes: 1 addition & 1 deletion tfjs-backend-webgpu/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module.exports = function(config) {
require('karma-jasmine-html-reporter'),
],
exclude,
port: 9876,
port: 9200,
colors: true,
autoWatch: false,
browsers: ['Chrome', 'chrome_webgpu'],
Expand Down
3 changes: 2 additions & 1 deletion tfjs-core/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ tfjs_web_test(
],
browsers = [
"bs_chrome_mac",
"bs_firefox_mac",
# TODO(mattSoulanille): Re-enable firefox once it works on browserstack.
# "bs_firefox_mac",
"bs_safari_mac",
"bs_ios_12",
"bs_android_10",
Expand Down
3 changes: 2 additions & 1 deletion tfjs-core/src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ tfjs_web_test(
name = "worker_test",
browsers = [
"bs_chrome_mac",
"bs_firefox_mac",
# TODO(mattSoulanille): Re-enable firefox once it works on browserstack.
# "bs_firefox_mac",
"bs_safari_mac",
# Temporarily disabled because BrowserStack does not support loading
# absolute paths in iOS, which is required for loading the worker.
Expand Down
9 changes: 9 additions & 0 deletions tfjs-core/src/ops/range_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,13 @@ describeWithFlags('range', ALL_ENVS, () => {
expect(a.dtype).toEqual('int32');
expect(a.shape).toEqual([3]);
});

it('should support large number for int32 dtype', async () => {
const length = Math.pow(2, 24) + 10;
const a = tf.range(1, length, 1, 'int32');
const data = await a.data();
expect(data[length - 2]).toEqual(length - 1);
expect(a.dtype).toEqual('int32');
expect(a.shape).toEqual([length - 1]);
});
});
2 changes: 1 addition & 1 deletion tfjs-data/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = function(config) {
{tsconfig: 'tsconfig.json', compilerOptions: {module: 'commonjs'}},
reporters: ['progress', 'karma-typescript'],
browsers: ['Chrome'],
port: 9876,
port: 9200,
browserStack: {
username: process.env.BROWSERSTACK_USERNAME,
accessKey: process.env.BROWSERSTACK_KEY,
Expand Down
3 changes: 2 additions & 1 deletion tfjs-layers/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ tfjs_web_test(
],
browsers = [
"bs_chrome_mac",
"bs_firefox_mac",
# TODO(mattSoulanille): Re-enable firefox once it works on browserstack.
# "bs_firefox_mac",
# disabled android test due to training flakiness
# "bs_android_10",
"win_10_chrome",
Expand Down
2 changes: 1 addition & 1 deletion tfjs-layers/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module.exports = function(config) {
karmaTypescriptConfig,
reporters: ['progress', 'karma-typescript'],
browsers: ['Chrome'],
port: 9846,
port: 9200,
browserStack: {
username: process.env.BROWSERSTACK_USERNAME,
accessKey: process.env.BROWSERSTACK_KEY,
Expand Down
4 changes: 2 additions & 2 deletions tfjs-layers/src/layers/nlp/models/backbone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { serialization } from '@tensorflow/tfjs-core';
import { ContainerArgs } from '../../../engine/container';
import { LayersModel } from '../../../engine/training';
import { NotImplementedError } from '../../../errors';
import { Layer } from '../../../exports_layers';
import { Embedding } from '../../embeddings';

export class Backbone extends LayersModel {
/** @nocollapse */
Expand All @@ -38,7 +38,7 @@ export class Backbone extends LayersModel {
/**
* A `tf.layers.embedding` instance for embedding token ids.
*/
get tokenEmbedding(): Layer {
get tokenEmbedding(): Embedding {
throw new NotImplementedError();
}

Expand Down
Loading

0 comments on commit 0f4c3cd

Please sign in to comment.