Skip to content

CI: disable 4 tests, enable autodiff tests on Windows #35384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/AutoDiff/validation-test/derivative_registration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ DerivativeRegistrationTests.testWithLeakChecking("DerivativeGenericSignature") {
expectEqual(1000, dx)
}

#if REQUIRES_SRxxxx
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than disabling on all platforms, could we disable only for the Windows platform? I know there's some controversy here that that may be an antipattern.

Copy link
Member Author

Choose a reason for hiding this comment

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

We certainly could, though Im worried that there is a more delicate issue underlying these failures (it seems that the 4 failures are all caused by the same underlying cause related to casting). I think that @rxwei was interested in looking at the issue, but I figure that this helps get the tests running earlier rather than later.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm pretty sure the issues are related to the SIL differentiable function representation and reabstraction: something related to TF-851. This issue isn't caught in SIL verification because @differentiable-function-type-related instruction verification is also disabled: TF-1197.

The nature of the issue is pretty well understood, it should be fixable when it becomes a P0 for someone (I don't foresee personally prioritizing it).

// When non-canonicalized generic signatures are used to compare derivative configurations, the
// `@differentiable` and `@derivative` attributes create separate derivatives, and we get a
// duplicate symbol error in TBDGen.
Expand All @@ -236,6 +237,7 @@ DerivativeRegistrationTests.testWithLeakChecking("NonCanonicalizedGenericSignatu
// give a gradient of 1).
expectEqual(0, dx)
}
#endif

// Test derivatives of default implementations.
protocol HasADefaultImplementation {
Expand Down
6 changes: 6 additions & 0 deletions test/AutoDiff/validation-test/reabstraction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ extension Float: HasFloat {
init(float: Float) { self = float }
}

#if REQUIRES_SRxxxx
ReabstractionE2ETests.test("diff param generic => concrete") {
func inner<T: HasFloat>(x: T) -> Float {
7 * x.float * x.float
Expand All @@ -70,6 +71,7 @@ ReabstractionE2ETests.test("diff param generic => concrete") {
expectEqual(Float(7 * 3 * 3), transformed(3))
expectEqual(Float(7 * 2 * 3), gradient(at: 3, in: transformed))
}
#endif

ReabstractionE2ETests.test("nondiff param generic => concrete") {
func inner<T: HasFloat>(x: Float, y: T) -> Float {
Expand All @@ -80,6 +82,7 @@ ReabstractionE2ETests.test("nondiff param generic => concrete") {
expectEqual(Float(7 * 2 * 3), gradient(at: 3) { transformed($0, 10) })
}

#if REQUIRES_SRxxxx
ReabstractionE2ETests.test("diff param and nondiff param generic => concrete") {
func inner<T: HasFloat>(x: T, y: T) -> Float {
7 * x.float * x.float + y.float
Expand All @@ -88,7 +91,9 @@ ReabstractionE2ETests.test("diff param and nondiff param generic => concrete") {
expectEqual(Float(7 * 3 * 3 + 10), transformed(3, 10))
expectEqual(Float(7 * 2 * 3), gradient(at: 3) { transformed($0, 10) })
}
#endif

#if REQUIRES_SRxxxx
ReabstractionE2ETests.test("result generic => concrete") {
func inner<T: HasFloat>(x: Float) -> T {
T(float: 7 * x * x)
Expand All @@ -97,6 +102,7 @@ ReabstractionE2ETests.test("result generic => concrete") {
expectEqual(Float(7 * 3 * 3), transformed(3))
expectEqual(Float(7 * 2 * 3), gradient(at: 3, in: transformed))
}
#endif

ReabstractionE2ETests.test("diff param concrete => generic => concrete") {
typealias FnTy<T: Differentiable> = @differentiable (T) -> Float
Expand Down
1 change: 1 addition & 0 deletions utils/build-windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ cmake^
-DSWIFT_BUILD_SOURCEKIT:BOOL=YES^
-DSWIFT_ENABLE_SOURCEKIT_TESTS:BOOL=YES^
-DSWIFT_ENABLE_EXPERIMENTAL_CONCURRENCY=YES^
-DSWIFT_ENABLE_EXPERIMENTAL_DIFFERENTIABLE_PROGRAMMING=YES^
-DSWIFT_INSTALL_COMPONENTS="autolink-driver;compiler;clang-resource-dir-symlink;stdlib;sdk-overlay;editor-integration;tools;sourcekit-inproc;swift-remote-mirror;swift-remote-mirror-headers"^
-DSWIFT_PARALLEL_LINK_JOBS=8^
-DPYTHON_EXECUTABLE:PATH=%PYTHON_HOME%\python.exe^
Expand Down