instance_id stringlengths 10 65 | repo stringlengths 5 59 | pr_number int64 1 313k | task_type stringclasses 1
value | base_commit stringlengths 40 40 | review_commit stringlengths 40 40 | title stringlengths 2 282 | body stringlengths 7 3k | patch stringlengths 202 204k | n_defects int64 1 72 | n_supported int64 1 65 | n_major int64 0 32 | defects stringlengths 140 18.8k | certifier_count int64 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
uber__kraken__473 | uber/kraken | 473 | defect | 994acf8520e2c7669e0f228003cdc3317c622df1 | facd1ad402465d4dcc3dff6d4203de9eea294767 | feat(lib/store): initialize memory cache in castore | ## What?
Initialize memory cache and memorycache ttl worker in castore.
## Why?
This PR aims to initialize and setup memcache based on the configs added in the previous PRs. It also starts a background TTL worker which will cleanup the cache based on the TTL timeout
## How?
Use NewCaStore to create and initial... | diff --git a/lib/store/ca_store.go b/lib/store/ca_store.go
index d33968674..c02b69b24 100644
--- a/lib/store/ca_store.go
+++ b/lib/store/ca_store.go
@@ -19,6 +19,8 @@ import (
"io"
"os"
"path"
+ "sync"
+ "time"
"github.com/andres-erbsen/clock"
"github.com/docker/distribution/uuid"
@@ -27,21 +29,32 @@ import... | 10 | 5 | 1 | [{"id": "G0", "claim": "The variable `reclaimedBytes` in RemoveBatch is calculated but never used; remove it or add metrics tracking the reclaimed bytes for observability.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Using the TTL duration as ... | null |
uber__kraken__474 | uber/kraken | 474 | defect | 994acf8520e2c7669e0f228003cdc3317c622df1 | 11282bab7fb6f22759acf678269a84e8d22f674f | feat(lib/metainfogen): add method to generate metainfo from bytes | ## What?
Expose a method to generate metainfo from bytes rather than loading a cached file
## Why?
This is needed for in-memory cache
## How?
Just take the bytes and return the metainfo, no need to read a file and also write it. | diff --git a/lib/metainfogen/generator.go b/lib/metainfogen/generator.go
index 2537d9b49..24d0d2fa5 100644
--- a/lib/metainfogen/generator.go
+++ b/lib/metainfogen/generator.go
@@ -14,6 +14,7 @@
package metainfogen
import (
+ "bytes"
"fmt"
"github.com/uber/kraken/core"
@@ -57,3 +58,17 @@ func (g *Generator) G... | 4 | 3 | 0 | [{"id": "G0", "claim": "The size parameter is redundant and error-prone because the size can be derived from len(data); consider removing the size parameter and using int64(len(data)) directly.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The documenta... | null |
uber__kraken__475 | uber/kraken | 475 | defect | 994acf8520e2c7669e0f228003cdc3317c622df1 | 31e952eb596caf236511ce0b0420804c0a58d1e2 | feat(store/base): create an in-memory read writer | ## What?
Implement a in-memory `FileReadWriter`.
## Why?
`FileReadWriter` is required by CAstore for triggering the download and writing to disk. In our use case we want to use an in-memory buffer. This PR aims to implement that interface for an in-memory buffer.
## How?
Use `aws.WriteAtBuffer` as `utils/rwuti... | diff --git a/lib/metainfogen/generator.go b/lib/metainfogen/generator.go
index 2537d9b49..24d0d2fa5 100644
--- a/lib/metainfogen/generator.go
+++ b/lib/metainfogen/generator.go
@@ -14,6 +14,7 @@
package metainfogen
import (
+ "bytes"
"fmt"
"github.com/uber/kraken/core"
@@ -57,3 +58,17 @@ func (g *Generator) G... | 11 | 8 | 1 | [{"id": "G0", "claim": "The Seek error message should use lowercase 'seek' to follow Go error-message conventions.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The exported methods Close, Size, Cancel and Commit lack documentation comments and... | null |
uber__kraken__476 | uber/kraken | 476 | defect | 994acf8520e2c7669e0f228003cdc3317c622df1 | a8fce265de1a3ee16325eee0561d3e6280ad6597 | feat(utils/cache): add method to reserve cache space | ## What?
Add methods to reserve space in cache before adding to cache
## Why?
Since there are strict memory constraints for the in-memory cache in CAStore, if we don't reserve the space first and ask the downloader to download to memory directly, we risk at facing OOM issues. To prevent this, the cache implementat... | diff --git a/lib/metainfogen/generator.go b/lib/metainfogen/generator.go
index 2537d9b49..24d0d2fa5 100644
--- a/lib/metainfogen/generator.go
+++ b/lib/metainfogen/generator.go
@@ -14,6 +14,7 @@
package metainfogen
import (
+ "bytes"
"fmt"
"github.com/uber/kraken/core"
@@ -57,3 +58,17 @@ func (g *Generator) G... | 8 | 5 | 4 | [{"id": "G0", "claim": "ReleaseReservation refuses to release when the requested size exceeds the currently reserved amount, which can leak reserved space; it should release down to zero (or use saturating subtraction) instead of silently returning.", "category": "correctness", "verdict": "opposed", "priority": "P1", "... | null |
uber__kraken__477 | uber/kraken | 477 | defect | 994acf8520e2c7669e0f228003cdc3317c622df1 | 2be046f6eb41717900ae226ac42a59d6c3b6f14d | feat(lib): use in-memory cache in blob download | ## What?
Start using the in-memory cache in the download path.
## Why?
As part of implementing an in-mem cache in kraken.
## How?
Use the in-mem cache that was initialised in #473 to try to first download to the cache, and if not possible failback to disk.
This implementation also makes sure we try to reserve... | diff --git a/lib/blobrefresh/refresher.go b/lib/blobrefresh/refresher.go
index 3e389a49f..c61be3d62 100644
--- a/lib/blobrefresh/refresher.go
+++ b/lib/blobrefresh/refresher.go
@@ -103,7 +103,8 @@ func (r *Refresher) Refresh(namespace string, d core.Digest, hooks ...PostHook)
id := namespace + ":" + d.Hex()
err = r... | 13 | 10 | 4 | [{"id": "G0", "claim": "Items are added to the drain queue but no drain workers are ever started, so blobs added to memory cache may never be persisted to disk, potentially causing data loss if the process crashes before TTL eviction.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "intr... | null |
uber__kraken__478 | uber/kraken | 478 | defect | 994acf8520e2c7669e0f228003cdc3317c622df1 | aa82e319d85a720a57f4b6a4310275ed4848a17f | feat(lib/store): implement drain workers in castore | ## What?
Implement drain workers that drain the memcache element into the disk.
## Why?
The in-mem cache was added in the download path in #477. Since now it is populating the cache, this PR aims to implement the drain mechanism which is intended to start draining the entry in-mem cache to disk
## How?
Start n... | diff --git a/lib/blobrefresh/refresher.go b/lib/blobrefresh/refresher.go
index 3e389a49f..c61be3d62 100644
--- a/lib/blobrefresh/refresher.go
+++ b/lib/blobrefresh/refresher.go
@@ -103,7 +103,8 @@ func (r *Refresher) Refresh(namespace string, d core.Digest, hooks ...PostHook)
id := namespace + ":" + d.Hex()
err = r... | 6 | 4 | 0 | [{"id": "G0", "claim": "The '// To fix lint issues' comment should be replaced with a meaningful explanation such as 'This should never happen unless the queue contains non-drainItem values.'", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The 'for... | null |
uber__kraken__479 | uber/kraken | 479 | defect | 994acf8520e2c7669e0f228003cdc3317c622df1 | 5cad1581a2692e2d8ca9c24b32a843f17f666260 | feat(lib/store): integrate memcache in read paths | ## What?
Add all the read disk cache paths to first check in in-mem cache
## Why?
After https://github.com/uber/kraken/pull/477 and #478 , the download path is covered by the in-mem cache. Now while the entry is being drained to disk, the blob and it's metainfo can be served from the cache. This ensures we don't l... | diff --git a/lib/blobrefresh/refresher.go b/lib/blobrefresh/refresher.go
index 3e389a49f..c61be3d62 100644
--- a/lib/blobrefresh/refresher.go
+++ b/lib/blobrefresh/refresher.go
@@ -103,7 +103,8 @@ func (r *Refresher) Refresh(namespace string, d core.Digest, hooks ...PostHook)
id := namespace + ":" + d.Hex()
err = r... | 8 | 6 | 1 | [{"id": "G0", "claim": "The hardcoded string literal \"_torrentmeta\" in GetCacheFileMetadata should be replaced with the existing _torrentMetaSuffix constant (or a public accessor for it) to avoid hardcoding and ensure consistency.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "in... | null |
uber__kraken__493 | uber/kraken | 493 | defect | 130ecacd39b412527363a492267b2b6db93d0ead | 880d7ec25c9d17fc43df437ecb7702656ce97683 | fix(lib/store): initialise BufferedReadWriter with size | ## What?
Initialise the `BufferedReadWriter` for writing blobs with the size of the blob
## Why?
Currently, we initialise with 0 and it dynamically increase the size of the buffer which allocates a new buffer of the updated size and copies the existing to new one. This causes frequent copy and reallocs, causing la... | diff --git a/lib/store/base/buffer_readwriter.go b/lib/store/base/buffer_readwriter.go
index 98ff33e20..510ddb556 100644
--- a/lib/store/base/buffer_readwriter.go
+++ b/lib/store/base/buffer_readwriter.go
@@ -30,8 +30,9 @@ type BufferReadWriter struct {
}
// NewBufferReadWriter creates a new BufferReadWriter.
-func... | 2 | 2 | 0 | [{"id": "G0", "claim": "Use make([]byte, 0, size) instead of make([]byte, size) in NewBufferReadWriter, because a length-sized allocation zero-initialises all bytes, an unnecessary overhead, while aws.NewWriteAtBuffer grows the buffer as data is written.", "category": "performance", "verdict": "supported", "priority": ... | null |
uber__kraken__498 | uber/kraken | 498 | defect | 65dd0c9f53a14f1e28c55d1a1d94b61f26bed3ea | 0b7614bdd0b8343971089b37d0ce883f06da0114 | bug(utils/cache): prevent underflow of total size in memory cache | ## What?
Add checks to prevent underflow of `totalSize`.
## Why?
There can be cases when the size that is reserved and that actual blob size can vary, especially when the actual blob size is higher. While removing the blob, we decrement the `totalSize`. Although, the difference might be very less, it causes the `t... | diff --git a/utils/cache/blob_memory_cache.go b/utils/cache/blob_memory_cache.go
index 739055f38..8f28f225e 100644
--- a/utils/cache/blob_memory_cache.go
+++ b/utils/cache/blob_memory_cache.go
@@ -115,11 +115,20 @@ func (c *BlobMemoryCache) Remove(name string) {
}
delete(c.entries, name)
- c.totalSize -= entry.Si... | 6 | 1 | 0 | [{"id": "G0", "claim": "Setting totalSize to 0 when an underflow is detected is incorrect because the cache loses track of the sizes of all remaining entries; it should instead subtract what is available or recalculate the actual total size from the remaining entries.", "category": "correctness", "verdict": "uncertain"... | null |
uber__kraken__502 | uber/kraken | 502 | defect | 83c44a08a0165e8fbe960cd2bcdeb189cf2c4127 | f95fb01ada77c9e62da397ea613e44b22ec178de | fix(build-index): Add retry logic for manifest download during dependency resolution | # PR Description
## Problem
Clients frequently experience **"Failed to resolve dependencies in build-index"** errors during image pushes, particularly for images with large blob layers. This causes push operations to fail and requires manual retries.
### Root Cause
**Race condition between manifest upload a... | diff --git a/build-index/tagserver/server.go b/build-index/tagserver/server.go
index dbad20a67..c3f48d9ca 100644
--- a/build-index/tagserver/server.go
+++ b/build-index/tagserver/server.go
@@ -172,15 +172,15 @@ func (s *Server) readinessCheckHandler(w http.ResponseWriter, r *http.Request) e
func (s *Server) putTagHand... | 12 | 9 | 2 | [{"id": "G0", "claim": "The error returned by putTagHandler when dependency resolution fails should itself say where the failure occurred (include `resolve dependencies:` in the message) instead of only the handler prefix.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": ... | null |
uber__kraken__508 | uber/kraken | 508 | defect | 0485100eed0c167a511e56f158fe4a15fb04c639 | f8c1a2d6ab7983d19972926ac249eb223801d4e3 | Adding tests to cmd.go and refactoring the heartbeat method (AI generated) | ## What?
- Extracted `heartbeatWithTicker` so the ticker and shutdown signal can be injected.
- Updated `heartbeat` to delegate to the helper.
- Added unit tests for flags, option builders, validation, and heartbeat logic.
## Why?
- Makes the heartbeat loop testable and easier to manage.
- Provides coverage ove... | diff --git a/agent/cmd/cmd.go b/agent/cmd/cmd.go
index 09a61325b..960320b67 100644
--- a/agent/cmd/cmd.go
+++ b/agent/cmd/cmd.go
@@ -255,8 +255,20 @@ func Run(flags *Flags, opts ...Option) {
// heartbeat periodically emits a counter metric which allows us to monitor the
// number of active agents.
func heartbeat(sta... | 4 | 4 | 1 | [{"id": "G0", "claim": "The heartbeat goroutine's done channel is never closed outside tests, so the goroutine and its ticker leak on agent shutdown; the reviewer asks to add a defer in Run that emits on the done channel.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"i... | null |
uber__kraken__522 | uber/kraken | 522 | defect | eb11825f26e0d838f0e6e9d8a1f1885dda663c69 | 6f113379d5b17cf6c2a98c8e6fe5a28df6909064 | feat: Upload metrics and logs on proxy side |
This PR adds observability improvements to the proxy side by implementing metrics collection and logging for blob upload operations. The changes enhance monitoring capabilities and debugging by tracking upload success/failure rates and logging detailed upload events.
Key Changes:
- Added success and failure met... | diff --git a/lib/dockerregistry/transfer/rw_transferer.go b/lib/dockerregistry/transfer/rw_transferer.go
index e79fafd90..6ecafd8b2 100644
--- a/lib/dockerregistry/transfer/rw_transferer.go
+++ b/lib/dockerregistry/transfer/rw_transferer.go
@@ -31,6 +31,8 @@ import (
// local origin cluster, and posts/gets tags via th... | 5 | 2 | 0 | [{"id": "G0", "claim": "The failure log in putBlobContent should format the error with %v (or wrap it) instead of %s, matching the formatting used by the neighbouring log.", "category": "maintainability", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The success log in putBlob... | null |
uber__kraken__529 | uber/kraken | 529 | defect | 883c902a31bfc58a27be6b96a1f2b2771c3231ef | bb6be4338438eb7b85862a480a0e4b57089aaaf0 | Fix golangci-lint errors across codebase #8 | 1. Used closers.Close() for deferred closes in non-test files
2. Used t.Cleanup() with require.NoError() in test files
3. Checked all type assertions with proper error handling
4. Changed transport() method to return error instead of panic | diff --git a/build-index/tagserver/server_test.go b/build-index/tagserver/server_test.go
index 2d9db57e9..90abefbfa 100644
--- a/build-index/tagserver/server_test.go
+++ b/build-index/tagserver/server_test.go
@@ -143,8 +143,8 @@ func TestHealth(t *testing.T) {
resp, err := httputil.Get(
fmt.Sprintf("http://%s/he... | 2 | 1 | 0 | [{"id": "G0", "claim": "The new type-assertion error messages should be more descriptive and follow Go conventions, using a format string that shows the actual type received, such as \"expected X, got %T\".", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "... | null |
uber__kraken__532 | uber/kraken | 532 | defect | 32a188affb0a3d53d538570945a15c1e226d1de7 | b5f243c68137403a5f03d5e4c0adb295fc0b97f9 | Fix golangci-lint errors across codebase #9 | Continue fixing lint errors for the repo before activation of the lint-ci. | diff --git a/lib/store/ca_store_test.go b/lib/store/ca_store_test.go
index 8efcbce04..863db24ee 100644
--- a/lib/store/ca_store_test.go
+++ b/lib/store/ca_store_test.go
@@ -92,15 +92,21 @@ func TestCAStoreInitVolumesAfterChangingVolumes(t *testing.T) {
volume1, err := os.MkdirTemp("/tmp", "volume")
require.NoErro... | 3 | 3 | 0 | [{"id": "G0", "claim": "In TestTorrentWriteSamePieceConcurrent, use defer instead of t.Cleanup() inside the goroutine so the reader closes when the goroutine finishes rather than at test completion.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": ... | null |
uber__kraken__533 | uber/kraken | 533 | defect | 869b5cac58342f74ee8e4fe6aa2d478994c51c5f | 6c4e1dd3a2d4f6c5a9ca74d623681e857de8f90e | Improve observability on kraken-origin load | - add metric for number of concurrent blob downloads from backend storage (GCS, S3, etc.)
- add metric for number of total aggro GC runs of disk cache
- tag error logs in the ImagePrefetch API with the image tag
| diff --git a/lib/blobrefresh/refresher.go b/lib/blobrefresh/refresher.go
index f8f902925..32612fbca 100644
--- a/lib/blobrefresh/refresher.go
+++ b/lib/blobrefresh/refresher.go
@@ -68,7 +68,10 @@ func New(
"module": "blobrefresh",
})
- requests := dedup.NewRequestCache(dedup.RequestCacheConfig{}, clock.New())
+ ... | 4 | 2 | 1 | [{"id": "G0", "claim": "The log field key \"image tag\" uses a space, inconsistent with the snake_case logging convention used throughout the codebase, and should be \"tag\" or \"image_tag\".", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Taggin... | null |
uber__kraken__534 | uber/kraken | 534 | defect | fea5d1e32bc87362d489d94847084c832c15997e | a444ae4e3295d459cb54dd59e838f43045c0d73c | Add unit tests for localdb package [AI generated] | ## What?
Add comprehensive unit tests for the `localdb` package, achieving **100% test coverage** on the `New()` function in `database.go`.
## Why?
The `localdb` package is a critical component that provides embedded SQLite database functionality for Kraken's persisted retry queues (tag replication and writeback). D... | diff --git a/localdb/database.go b/localdb/database.go
index 1ae08dc0c..880c0d3ee 100644
--- a/localdb/database.go
+++ b/localdb/database.go
@@ -14,6 +14,7 @@
package localdb
import (
+ "database/sql"
"fmt"
_ "github.com/uber/kraken/localdb/migrations" // Add migrations.
@@ -24,22 +25,30 @@ import (
"github... | 2 | 1 | 0 | [{"id": "G0", "claim": "The tests contain duplicated code that could be avoided by making them table-driven.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The manual mock save/restore boilerplate could use t.Cleanup instead, and the same applie... | null |
uber__kraken__535 | uber/kraken | 535 | defect | fea5d1e32bc87362d489d94847084c832c15997e | 10f91133ed66e7e8273f9f512e5bb67b39c788c9 | Tracing putTag | This pull request adds OpenTelemetry distributed tracing support to the build-index tag server's putTag operation. The changes enable tracing of Docker push operations through the system, making it easier to debug and monitor performance.
1. Request Entry Point (Build-Index Server)
- otelhttp.NewMiddleware automati... | diff --git a/build-index/cmd/cmd.go b/build-index/cmd/cmd.go
index 77f123cab..55687ada0 100644
--- a/build-index/cmd/cmd.go
+++ b/build-index/cmd/cmd.go
@@ -37,6 +37,7 @@ import (
"github.com/uber/kraken/utils/log"
"github.com/uber-go/tally"
+ "go.opentelemetry.io/otel"
"go.uber.org/zap"
)
@@ -215,6 +216,7 @... | 5 | 2 | 1 | [{"id": "G0", "claim": "The helper functions s.putTag() and s.replicateTag() are called without the trace context, so the log statements inside them will not include trace_id/span_id and the trace is incomplete; the reviewer asks to update the signatures to accept context.Context and pass ctx to them.", "category": "co... | null |
uber__kraken__538 | uber/kraken | 538 | defect | fea5d1e32bc87362d489d94847084c832c15997e | e13d9347a2aed76f448ab06c09d87774df8bb657 | Fix golangci-lint errors across codebase #10 | Continue fixing lint errors for the repo before activation of the lint-ci. | diff --git a/lib/store/ca_store_test.go b/lib/store/ca_store_test.go
index 863db24ee..cf249c6ac 100644
--- a/lib/store/ca_store_test.go
+++ b/lib/store/ca_store_test.go
@@ -175,7 +175,9 @@ func TestCAStoreCreateUploadFileAndMoveToCache(t *testing.T) {
f, err := s.uploadStore.newFileOp().GetFileReader(src, 0 /* read... | 2 | 1 | 1 | [{"id": "G0", "claim": "In TestHealth, the t.Cleanup closure closing resp.Body is registered before the httputil.Get error is checked, so if Get returns an error resp could be nil and t.Cleanup would panic when calling resp.Body.Close(); the registration should be moved after the error check.", "category": "correctness... | null |
uber__kraken__540 | uber/kraken | 540 | defect | 812f74437d6db891fea32734bff2d5ba2ba1bbd9 | 24806d070619d50291ae92e66c70647b00972fa8 | Fix golangci-lint errors across codebase #11 | Continue fixing lint errors for the repo before activation of the lint-ci. | diff --git a/lib/backend/shadowbackend/client.go b/lib/backend/shadowbackend/client.go
index d73f476b2..dca70b2bb 100644
--- a/lib/backend/shadowbackend/client.go
+++ b/lib/backend/shadowbackend/client.go
@@ -144,6 +144,9 @@ func getBackendClient(backendConfig map[string]interface{}, authConfRaw interfac
return ni... | 2 | 1 | 0 | [{"id": "G0", "claim": "Maybe use t.Fatal() instead of panicking in the statusWithBodyHandler test helper when w.Write fails.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Consider panicking instead of returning an empty slice on error in randutil.Blob ... | null |
uber__kraken__545 | uber/kraken | 545 | defect | fea5d1e32bc87362d489d94847084c832c15997e | f1c78843712ad6ec7cd6dc0fb90180f10029292b | feat: client side tracing upload path | # Summary
Implement end-to-end distributed tracing for Docker blob upload paths in Kraken, enabling observability from proxy → origin. This PR adds OpenTelemetry instrumentation to the client upload flow with hierarchical span creation and trace context propagation.
# Motivation
Debugging slow or failed Docker pus... | diff --git a/build-index/cmd/cmd.go b/build-index/cmd/cmd.go
index 77f123cab..55687ada0 100644
--- a/build-index/cmd/cmd.go
+++ b/build-index/cmd/cmd.go
@@ -37,6 +37,7 @@ import (
"github.com/uber/kraken/utils/log"
"github.com/uber-go/tally"
+ "go.opentelemetry.io/otel"
"go.uber.org/zap"
)
@@ -215,6 +216,7 @... | 6 | 4 | 3 | [{"id": "G0", "claim": "ReadWriteTransferer.Upload starts its span from context.Background() instead of the incoming request context, breaking end-to-end trace correlation (proxy → origin); the request context should be threaded through the transfer.ImageTransferer interface and used when starting the span and calling ... | null |
uber__kraken__548 | uber/kraken | 548 | defect | fea5d1e32bc87362d489d94847084c832c15997e | 8ae75b4fafb712b04690893db19d1b4419e15c35 | feat: Add tracing to origin DownloadBlob operation | This PR introduces context-aware, traced DownloadBlob operations in the origin blob client and propagates the new signature throughout the call chain (cluster client, proxy prefetch/preheat, registry transfer, and tag resolution), along with corresponding test and mock updates.
Changes:
- Extend blobclient.Client... | diff --git a/build-index/cmd/cmd.go b/build-index/cmd/cmd.go
index 77f123cab..55687ada0 100644
--- a/build-index/cmd/cmd.go
+++ b/build-index/cmd/cmd.go
@@ -37,6 +37,7 @@ import (
"github.com/uber/kraken/utils/log"
"github.com/uber-go/tally"
+ "go.opentelemetry.io/otel"
"go.uber.org/zap"
)
@@ -215,6 +216,7 @... | 4 | 2 | 2 | [{"id": "G0", "claim": "Anton asks whether the cluster client should treat a blob-not-found response as an error in the span, since missing blobs are common in production but sometimes indicate a real problem (writeback delay), so it is unclear if this scenario should be treated as an error or as normal.", "category": ... | null |
uber__kraken__553 | uber/kraken | 553 | defect | 5a7daa4d541f4238a56174adcbe550eb09456f39 | ee81c88c7d2d64273010895366e9eff353348423 | The final batch of lint fixes & activation of the lint action | ## Summary
Fixes remaining golangci-lint errors across the codebase and re-enables linting in GitHub Actions CI pipeline.
## Changes
### CI/CD
- **`.github/workflows/build-and-test.yaml`**: Re-enabled golangci-lint job by removing `if: false` condition
### Type Safety Improvements
**Added pr... | diff --git a/.github/workflows/build-and-test.yaml b/.github/workflows/build-and-test.yaml
index c4edebfd3..d77682fcc 100644
--- a/.github/workflows/build-and-test.yaml
+++ b/.github/workflows/build-and-test.yaml
@@ -13,9 +13,6 @@ env:
jobs:
lint:
runs-on: ubuntu-latest
- # Temporary deactivate the lint-ci ... | 2 | 1 | 0 | [{"id": "G0", "claim": "The stats parameter, which this PR left in the tagstore.New signature after removing its only usage, should be marked explicitly unused (e.g. `_ = stats`) or accompanied by a comment explaining why it is retained for API compatibility.", "category": "maintainability", "verdict": "supported", "pr... | null |
uber__kraken__560 | uber/kraken | 560 | defect | 6dc6a4b4ad75ece784fa84db1fdd437a455af6df | 0023a088c0ecbb58c62579fc7684a9082757366b | feat(origin): add diagnostics to origin hash ring mismatch | Currently, when an origin fails to find itself in the hash ring, limited information regarding the state of the hash ring is logged.
This PR improves observability by adding logs for:
- The hash ring members and DNS results when a hash ring mismatch occurs
- The full list of hash ring members upon initialisation... | diff --git a/origin/cmd/cmd.go b/origin/cmd/cmd.go
index 4c8c1537c..2511f0146 100644
--- a/origin/cmd/cmd.go
+++ b/origin/cmd/cmd.go
@@ -17,6 +17,7 @@ import (
"encoding/json"
"flag"
"fmt"
+ "net"
"net/http"
"os"
@@ -258,7 +259,14 @@ func Run(flags *Flags, opts ...Option) {
}
addr = fmt.Sprintf("%s:%d... | 7 | 6 | 0 | [{"id": "G0", "claim": "The new log metadata key should be \"ring_members\" rather than \"ringMembers\", because the project uses snake_case when adding metadata keys to logs or metrics.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Logging onl... | null |
uber__kraken__567 | uber/kraken | 567 | defect | 61357e7f83162a83d5eac95cd9aefb72ee17b8eb | a275c887bbbc15d2ba2718c3b5cd0e2d29ea76b8 | feat(origin): add retry mechanism for origin hash ring membership | Currently, if an origin cannot find itself in the hash ring, it crashes. This often happens when DNS records have not yet propagated.
This PR introduces the following changes:
- Adds logic to retry and wait for the origin to appear in the hash ring, allowing for DNS records to propagate.
- Tracks the duration re... | diff --git a/origin/cmd/cmd.go b/origin/cmd/cmd.go
index cc1a71005..553e176a8 100644
--- a/origin/cmd/cmd.go
+++ b/origin/cmd/cmd.go
@@ -20,6 +20,7 @@ import (
"net"
"net/http"
"os"
+ "time"
"github.com/uber/kraken/core"
"github.com/uber/kraken/lib/backend"
@@ -50,6 +51,11 @@ import (
"go.uber.org/zap"
)... | 7 | 7 | 2 | [{"id": "G0", "claim": "Encapsulate all hash-ring membership observability (logs, metrics) inside the membership helper and move the hashring-related logic out of cmd.go into the hashring package, leaving Run as a single call with just error handling, for better separation of concerns.", "category": "design", "verdict"... | null |
uber__kraken__568 | uber/kraken | 568 | defect | 61357e7f83162a83d5eac95cd9aefb72ee17b8eb | 6bfd0f5905fad06a65099365d43d6bc9f17ab224 | Close multiple small bugs | ## Summary ... | diff --git a/agent/agentserver/server.go b/agent/agentserver/server.go
index a4a7fe221..315fe9807 100644
--- a/agent/agentserver/server.go
+++ b/agent/agentserver/server.go
@@ -159,6 +159,7 @@ func (s *Server) downloadBlobHandler(w http.ResponseWriter, r *http.Request) err
return handler.Errorf("store: %s", err)
... | 10 | 9 | 2 | [{"id": "G0", "claim": "CheckReadiness calls Locations twice (once for the length guard, once to index [0]), so a membership change between the calls can still make it panic or behave inconsistently; store the result in a local variable, validate it once, and read the first element from that same slice.", "category": "... | null |
uber__kraken__572 | uber/kraken | 572 | defect | 013b23dc9a0f27f0b3327c0c040fea5fa3ac6ec8 | 366e6b0340dd0b72e8964b9af6dd473aca0786c4 | feat(cache): make LRU cache config-driven | ## Description
*Note: This PR was pivoted based on maintainer feedback.*
This PR makes the core LRU cache configuration-driven. Previously, the LRU cache relied on explicitly passed size and TTL parameters. This change introduces a `Config` struct in `utils/cache/config.go`, adhering to the standard configuration p... | diff --git a/lib/dockerregistry/config.go b/lib/dockerregistry/config.go
index cbe4499a2..041ebd3ad 100644
--- a/lib/dockerregistry/config.go
+++ b/lib/dockerregistry/config.go
@@ -14,6 +14,9 @@
package dockerregistry
import (
+ "errors"
+ "time"
+
"github.com/docker/distribution/configuration"
"github.com/dock... | 6 | 6 | 6 | [{"id": "G0", "claim": "The validation error is wrapped with %s, which loses the original error for errors.Is/As unwrapping; use %w instead.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "The new cache tests only assert call counts and would pass ev... | null |
uber__kraken__585 | uber/kraken | 585 | defect | 8b41b928d6e2becc1a36f3749b808f72ad12e9fd | 233dd5da6c006dd9402ad407012a2be460f71c8c | feat(agent): add config to tune origin to agent multiplexing level | Currently, the P2P algo parallelizes a torrent download from up to 10 peers, downloading up to N torrent pieces from a peer concurrently (also called multiplexing). This level of multiplexing is currently configurable, but must be the same for agents and origins (both of which are considered peers). This PR makes it so... | diff --git a/.gitignore b/.gitignore
index a50919e22..d4a49759e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
.idea
.tmp
.vscode
+.claude/settings.local.json
*.test
*.go~
vendor/
diff --git a/lib/torrent/scheduler/conn/conn.go b/lib/torrent/scheduler/conn/conn.go
index 465b0f46a..306f982ff 100644
--- a... | 2 | 1 | 0 | [{"id": "G0", "claim": "Asks whether adding .claude/settings.local.json to .gitignore was an unintended change to the pull request.", "category": "correctness", "verdict": "uncertain", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The doc comment should be reworded to '// IsPeerOrigin returns whether... | null |
uber__kraken__594 | uber/kraken | 594 | defect | 7701e099002e5c9448e92d60b80e73f6e14906a9 | 1689d1347c1e3f1cf285391203fa1059cfa10762 | feat(agent): emit e2e torrent download throughput metric | Currently, we emit the following metrics for kraken-agent blob download performance:
1. leeching throughput from the p2p network (excludes the time to get metainfo from origin from the throughput calculation)
2. e2e torrent download time, including metainfo download.
This PR adds a 3rd metric - e2e throughput for ... | diff --git a/lib/torrent/scheduler/buckets.go b/lib/torrent/scheduler/buckets.go
index bec6ae716..13871f43d 100644
--- a/lib/torrent/scheduler/buckets.go
+++ b/lib/torrent/scheduler/buckets.go
@@ -25,45 +25,55 @@ const (
)
var (
- _sizeBoundaries = []uint64{0, 100 * memsize.MB, memsize.GB, 2 * memsize.GB, 5 * memsi... | 3 | 2 | 0 | [{"id": "G0", "claim": "The nested append(...) parenthesis ladder that replaced the linear bucket initialization is significantly harder to read and verify; keep the original init/linear-append formatting for readability.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"},... | null |
uber__kraken__595 | uber/kraken | 595 | defect | 890bc1a2c5b9e68eb4bf351864412dfaa8a8f2cf | 8999f6ee3b30c4512ca82d7332643f8d4740806a | feat: add ability to enable mutex profile | # What?
Add the ability to enable mutex profile fraction in all services of Kraken
# Why?
As of now, there's no way to enable mutex profile contention. As we are exploring different types of hosts for kraken we need to verify the performance changes by profiling. For debugging, a mutex profile is needed rather tha... | diff --git a/agent/cmd/cmd.go b/agent/cmd/cmd.go
index bc9c1862e..b887d6b45 100644
--- a/agent/cmd/cmd.go
+++ b/agent/cmd/cmd.go
@@ -17,6 +17,7 @@ import (
"flag"
"fmt"
"net/http"
+ "runtime"
"sync"
"time"
@@ -42,14 +43,15 @@ import (
// Flags defines agent CLI flags.
type Flags struct {
- PeerIP ... | 6 | 2 | 1 | [{"id": "G0", "claim": "Consider making the hardcoded --mutex-profile-fraction=1 in the devcluster agent container startup scripts configurable (env var/arg) or using a less aggressive sampling rate by default, since full contention profiling adds overhead during normal dev runs.", "category": "performance", "verdict":... | null |
uber__neuropod__10 | uber/neuropod | 10 | defect | 9d8c5168a5d69ff67d0eaf657a4ddae7496bc020 | 5bbbcac580294f5239945e1cf875f7b49f6d818f | Add TensorFlow Backend for Neuropods (C++) | Note: most of this PR has previously been reviewed internally | diff --git a/build/allowed_deps.txt b/build/allowed_deps.txt
index 147be043..3de6ebb2 100644
--- a/build/allowed_deps.txt
+++ b/build/allowed_deps.txt
@@ -12,4 +12,5 @@
0x0000000000000001 (NEEDED) Shared library: [libneuropods.so]
0x0000000000000001 (NEEDED) Shared library: [libpython2.7.so.... | 1 | 1 | 0 | [{"id": "G0", "claim": "The graph file is not closed if an exception is thrown, because the explicit close is only reached on the success path.", "category": "correctness", "verdict": "supported", "priority": "P3", "scope": "introduced"}] | null |
uber__neuropod__129 | uber/neuropod | 129 | defect | 1629c4e096e864653acc91f142ddc8cd29f3c6ef | 8f65ceb2aacf5a32c5365772d70fb7ffa83385df | Add accessors to TypedNeuropodTensor | This PR adds accessors for efficient access to data in tensors.
Inspired by accessors in libtorch (https://pytorch.org/cppdocs/notes/tensor_basics.html#efficient-access-to-tensor-elements) | diff --git a/source/neuropods/internal/BUILD b/source/neuropods/internal/BUILD
index 6ca25658..1959206f 100644
--- a/source/neuropods/internal/BUILD
+++ b/source/neuropods/internal/BUILD
@@ -39,6 +39,7 @@ cc_library(
"neuropod_tensor.cc",
],
hdrs = [
+ "tensor_accessor.hh",
"neuropod_... | 2 | 2 | 1 | [{"id": "G0", "claim": "The operator[]/operator() operators on TypedNeuropodTensor should be removed (in some diff) because they are very slow and users are unlikely to know it.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "pre_existing"}, {"id": "G1", "claim": "A test should be added for ... | null |
uber__neuropod__133 | uber/neuropod | 133 | defect | 9c4b58b84429b4390e8dfa658963d65312b6b52c | 943893478d39d98ccd9c1eafab5d006f307e4ed1 | [OPE Part 1] Shared memory allocator | A memory allocator that can allocate chunks of shared memory (with intelligent reuse of existing blocks).
(Originally part of #123) | diff --git a/source/neuropods/multiprocess/shm_allocator.cc b/source/neuropods/multiprocess/shm_allocator.cc
new file mode 100644
index 00000000..776e31e3
--- /dev/null
+++ b/source/neuropods/multiprocess/shm_allocator.cc
@@ -0,0 +1,257 @@
+//
+// Uber, Inc. (c) 2019
+//
+
+#include "neuropods/multiprocess/shm_allocato... | 8 | 7 | 1 | [{"id": "G0", "claim": "Generating proper UUIDs under a mutex costs inter-thread synchronization, and a cheaper unique id (process id plus an atomic sequence) might avoid that slowdown.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The new allocato... | null |
uber__neuropod__163 | uber/neuropod | 163 | defect | 787e84f78758fb5d80a3f840578ab231fd0e07aa | ee42ad38ee76dfa73aa0f1346088266620e24967 | Fix GIL issues with PythonBridge in multithreaded environments | This PR fixes an issue where PyTorch models calling `.cuda()` would hang forever in multithreaded environments.
The first `.cuda()` call in a PyTorch session calls [`cuda_lazy_init()`](https://github.com/pytorch/pytorch/blob/master/torch/csrc/utils/cuda_lazy_init.cpp#L13)
This attempts to lock the GIL using [`Aut... | diff --git a/build/run_cpp_tests.py b/build/run_cpp_tests.py
index 5b92bf26..edc88689 100644
--- a/build/run_cpp_tests.py
+++ b/build/run_cpp_tests.py
@@ -7,8 +7,10 @@
# integrity protection on Mac.
# Because of this, we're manually running all the bazel tests
+import argparse
import re
import subprocess
+import ... | 1 | 1 | 0 | [{"id": "G0", "claim": "Suggest also running several parallel threads concurrently for some time in the threaded test, to flush out other possible multithreading issues.", "category": "testing", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
uber__neuropod__178 | uber/neuropod | 178 | defect | 0062db162ea35cf632fd72ce16758434647a6db7 | 1adb89b0c7d8c48450bc1cc47777c6f0839da444 | Add factory functions for creating tensors | Adds `zeros`, `ones`, `full`, `randn`, `arange`, and `eye` along with tests | diff --git a/source/neuropods/backends/tensor_allocator.hh b/source/neuropods/backends/tensor_allocator.hh
index daad6fa2..f6882982 100644
--- a/source/neuropods/backends/tensor_allocator.hh
+++ b/source/neuropods/backends/tensor_allocator.hh
@@ -8,6 +8,7 @@
#include "neuropods/internal/neuropod_tensor.hh"
#include "... | 3 | 3 | 0 | [{"id": "G0", "claim": "Consider replacing the `i*step` multiplication in the `arange` fill loop with two counters (i+1, j+step), which should be a bit more optimized for some architectures.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The `actual... | null |
uber__neuropod__221 | uber/neuropod | 221 | defect | bba5c6f769a0b39bfb221956165197c3eee32d8a | 6726f9a9fc0c7b510c28bda8f5e36c5679d2eb4f | Move begin/end from TypedNeuropodTensor to TensorAccessor | This PR enables range-based for loops using accessors | diff --git a/source/neuropods/internal/neuropod_tensor.hh b/source/neuropods/internal/neuropod_tensor.hh
index bdff7bce..ea981c1c 100644
--- a/source/neuropods/internal/neuropod_tensor.hh
+++ b/source/neuropods/internal/neuropod_tensor.hh
@@ -255,7 +255,7 @@ public:
{
static_assert(N > 0, "`accessor()` is... | 2 | 1 | 0 | [{"id": "G0", "claim": "Please clarify why `dims_[0]` is the correct one-past-the-end pointer in `TensorAccessor<T,1>::end()` (the reviewer expected something like a cumprod of strides/dims).", "category": "correctness", "verdict": "opposed", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The correctn... | null |
uber__neuropod__267 | uber/neuropod | 267 | defect | 47c330cec3363c763a8c070f96c0b518f1f98fab | 2dda3df16ceabdca0e42ee088be59e181c16024e | [OPE] Add LOAD_SUCCESS message | Wait for the worker process to confirm that a model was loaded successfully before returning from the constructor of `MultiprocessNeuropodBackend`
This is useful for unit tests that make sure a model can correctly be loaded using OPE | diff --git a/source/neuropod/multiprocess/control_messages.cc b/source/neuropod/multiprocess/control_messages.cc
index f8c51c3d..9d53a5bb 100644
--- a/source/neuropod/multiprocess/control_messages.cc
+++ b/source/neuropod/multiprocess/control_messages.cc
@@ -18,6 +18,7 @@ std::ostream &operator<<(std::ostream &out, con... | 2 | 2 | 0 | [{"id": "G0", "claim": "The error raised on an unexpected message from the worker should give more context about what message was expected.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Some logging should be added where the backend starts wait... | null |
uber__neuropod__271 | uber/neuropod | 271 | defect | 2ec57506c1bfd5d421493a9d249102734e35b49a | 902bdf61b12eee286248d65bf202cdce9ef67d50 | Refactor NeuropodBackend to introduce an infer_internal method | This renames the existing virtual `infer` method in `NeuropodBackend` to `infer_internal`.
A new non-virtual `infer` method is introduced in `NeuropodBackend` to let us extract common functionality in the future (e.g. shape/type checking, etc).
This mirrors the design of the python implementation | diff --git a/source/neuropod/backends/neuropod_backend.cc b/source/neuropod/backends/neuropod_backend.cc
index 02c69560..b48b3617 100644
--- a/source/neuropod/backends/neuropod_backend.cc
+++ b/source/neuropod/backends/neuropod_backend.cc
@@ -42,15 +42,22 @@ const std::vector<TensorSpec> &NeuropodBackend::get_outputs()... | 1 | 1 | 0 | [{"id": "G0", "claim": "The names infer/forward do not make the difference between the user-facing and backend-implemented paths clear enough, and the methods should be renamed to something like infer/infer_internal.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
uber__neuropod__276 | uber/neuropod | 276 | defect | 51a0a55399ba72d91ed4b210b0e2b079ae86f37a | 8078744601fe02ad0af25a13092481662e003f4a | Add option to manually load model after backend construction | Instead of automatically loading the underlying model in the constructors of the various `NeuropodBackend` implementations, we add support for users to manually trigger the load after construction.
By setting the `load_model_at_construction` option to false, users can construct a Neuropod without loading the model a... | diff --git a/source/neuropod/backends/neuropod_backend.cc b/source/neuropod/backends/neuropod_backend.cc
index efd3a6bb..21898b3a 100644
--- a/source/neuropod/backends/neuropod_backend.cc
+++ b/source/neuropod/backends/neuropod_backend.cc
@@ -13,11 +13,21 @@ namespace neuropod
NeuropodBackend::NeuropodBackend() = def... | 3 | 3 | 2 | [{"id": "G0", "claim": "Protect against (or at least warn about) calling `load_model` when no deferred loading was specified or when it is called more than once, preferably with an NEUROPOD_ERROR.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Using... | null |
uber__neuropod__280 | uber/neuropod | 280 | defect | 51a0a55399ba72d91ed4b210b0e2b079ae86f37a | d0d11fcfafab5d64e0515726083cc28d5d2582fa | Validate tensors against specs from C++ | Validate the shapes and types of tensors passed to `infer`. This mirrors the logic and implementation of the current Python tensor validation code. | diff --git a/source/WORKSPACE b/source/WORKSPACE
index a7d0c485..695fab72 100644
--- a/source/WORKSPACE
+++ b/source/WORKSPACE
@@ -138,3 +138,11 @@ http_archive(
url = "https://github.com/gabime/spdlog/archive/v1.4.2.zip",
strip_prefix = "spdlog-1.4.2",
)
+
+http_archive(
+ name = "fmt_repo",
+ build_f... | 5 | 4 | 1 | [{"id": "G0", "claim": "The new validate_tensors_against_specs function should be covered by proper unit tests.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "It is unclear whether the tensor type in the error message prints as a number or a string; if ... | null |
uber__neuropod__285 | uber/neuropod | 285 | defect | a5af6f8b779044788b14386c9265f36dac4d60b8 | aec401a5344b13dc64e6660102e1bbde8431ad97 | [OPE] Encapsulate control_message within the control channel implementation | In preparation for cross process moves of shm blocks, this PR encapsulates the raw `control_message` within the control channel implementation. | diff --git a/source/neuropod/multiprocess/control_messages.hh b/source/neuropod/multiprocess/control_messages.hh
index 19b36cf6..fc8e011f 100644
--- a/source/neuropod/multiprocess/control_messages.hh
+++ b/source/neuropod/multiprocess/control_messages.hh
@@ -80,23 +80,11 @@ constexpr int MESSAGE_TIMEOUT_MS = 5000;
// ... | 3 | 3 | 0 | [{"id": "G0", "claim": "The `msg` parameter of the new `try_send_message(MessageType msg)` should be renamed to `type` to match the `send_message` argument.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "`IPCControlChannel` should either know ab... | null |
uber__neuropod__298 | uber/neuropod | 298 | defect | e18da28ef757b94f4bf3eeed08ce6722be27cc0a | 617feeb9247b68b5100b742e55177ea0d0de26af | [OPE] Add serialization for IPC | Serialization for IPC has less strict requirements than normal serialization because the data is transient and will be written and read in different processes on the same machine (so we don't need to worry about things like endianness).
This PR introduces some basic serialization for IPC that will be used in an upco... | diff --git a/source/neuropod/multiprocess/BUILD b/source/neuropod/multiprocess/BUILD
index dc086755..c443deb8 100644
--- a/source/neuropod/multiprocess/BUILD
+++ b/source/neuropod/multiprocess/BUILD
@@ -17,6 +17,7 @@ cc_library(
"//neuropod/backends:neuropod_backend",
"//neuropod/internal:deleter",
... | 6 | 6 | 3 | [{"id": "G0", "claim": "The comment claiming ope_load_config can't be marked serializable because of a boost serialization bug should give more details or an external reference.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "ipc_serialize for Neur... | null |
uber__neuropod__299 | uber/neuropod | 299 | defect | e18da28ef757b94f4bf3eeed08ce6722be27cc0a | 5f10ad7cce0ea0d5562b2c42456e1496d04de364 | [OPE] Add WireFormat along with heartbeat and transferrables | This PR adds some utility classes that will be used as part of a refactor of the IPC message queues | diff --git a/source/neuropod/multiprocess/BUILD b/source/neuropod/multiprocess/BUILD
index dc086755..c443deb8 100644
--- a/source/neuropod/multiprocess/BUILD
+++ b/source/neuropod/multiprocess/BUILD
@@ -17,6 +17,7 @@ cc_library(
"//neuropod/backends:neuropod_backend",
"//neuropod/internal:deleter",
... | 9 | 7 | 1 | [{"id": "G0", "claim": "The destructor declaration has a stray space before `::` (`TransferrableController ::~TransferrableController`), which looks strange.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "A message should be logged if transferra... | null |
uber__neuropod__302 | uber/neuropod | 302 | defect | 3b0a9e505ec381e59facb83142867d2f884b5839 | a1b33ede5a04f8b5854ea25124e57d24fb6498d3 | [OPE] Add OPE to RuntimeOptions | Instead of having users call a separate `load_neuropod_in_new_process` function to use OPE, it is now just part of `RuntimeOptions`. | diff --git a/docs/advanced/ope.md b/docs/advanced/ope.md
index f670aa33..0af26771 100644
--- a/docs/advanced/ope.md
+++ b/docs/advanced/ope.md
@@ -3,14 +3,12 @@
Neuropod can run models in different processes using an optimized shared memory implementation with extremely low overhead (~100 to 500 microseconds).
-To... | 2 | 2 | 0 | [{"id": "G0", "claim": "The kwargs parser in the native bindings silently ignores unknown keyword arguments; the reviewer asks whether an alert/error is raised in that case.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "pre_existing"}, {"id": "G1", "claim": "In load_neuropod_ope, use `cons... | null |
uber__neuropod__304 | uber/neuropod | 304 | defect | a73ca68849dc76fea189a607fab31811a5818fc9 | 8b4184eacdd7b996e048c11f8719dbd9e6e19701 | [OPE] Add IPC message queue implementation | Adds a bidirectional IPC message queue that supports cross-process copies and transfers of generic user-specified payloads. The only requirement is that the payload must be serializable using `ipc_serialize`. The message queue also uses heartbeats in both directions to ensure that both processes are alive. | diff --git a/source/neuropod/internal/BUILD b/source/neuropod/internal/BUILD
index de4f016d..a3a7f2be 100644
--- a/source/neuropod/internal/BUILD
+++ b/source/neuropod/internal/BUILD
@@ -199,6 +199,16 @@ cc_library(
],
)
+cc_library(
+ name = "blocking_spsc_queue",
+ hdrs = [
+ "blocking_spsc_queue... | 5 | 1 | 0 | [{"id": "G0", "claim": "The local variable `in_transit_count` should be declared const.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "If no acknowledgement ever arrives from the other process, the process may end up hanging forever, and there i... | null |
uber__neuropod__308 | uber/neuropod | 308 | defect | a73ca68849dc76fea189a607fab31811a5818fc9 | eca6b077fea7e8f4b2f098684de40169c59faf3e | [OPE] Pass default_backend_overrides to the worker process | This PR passes default backend overrides to the worker process. | diff --git a/source/WORKSPACE b/source/WORKSPACE
index df4d837a..11f016ed 100644
--- a/source/WORKSPACE
+++ b/source/WORKSPACE
@@ -15,9 +15,9 @@ http_archive(
load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "llvm_toolchain")
-# This is a manylinux2010 compatible sysroot
+# This is a manylinux2014 compatibl... | 2 | 2 | 1 | [{"id": "G0", "claim": "The new `default_backend_overrides` argument of `load_neuropod_ope` should be documented.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Unit tests should be added for the pull request's changes, which at S1 left the new de... | null |
uber__neuropod__316 | uber/neuropod | 316 | defect | a73ca68849dc76fea189a607fab31811a5818fc9 | 9283b722eb881e999d6d557642e016ed5b63997e | Allow models to specify target framework versions | This PR allows models to specify target framework versions.
For example, if a model is only compatible with TensorFlow 1.15 (e.g. because of custom ops built against 1.15 headers), that can be specified at export time.
Target version ranges are specified as semver ranges (see https://semver.org/, https://docs.npm... | diff --git a/.gitignore b/.gitignore
index e7c9c3dd..a1c4c85c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,6 @@ bazel-out
bazel-source
bazel-testlogs
.vscode/
+source/neuropod/python/libneuropod.so
+source/neuropod/python/neuropod_multiprocess_worker
+source/neuropod/python/neuropod_native.so
diff --git a/b... | 3 | 3 | 1 | [{"id": "G0", "claim": "When more than one backend satisfies the version range, the user should be notified via logging that the match is not 1-1, and it should be settled that the newest one is picked.", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "It w... | null |
uber__neuropod__330 | uber/neuropod | 330 | defect | 46e4aee569399d3bb0d77281f95936fe9a5de345 | cbd298677cc76da4eef394ae42746a4f54350370 | Allow models to specify target framework versions [Part 2] | Enable the native code to load different default shared objects depending on the requested framework version.
A future PR will actually rename the `so` files depending on the version of the framework they're built against (e.g. `libneuropod_torchscript_1_4_0_cpu_backend.so`) | diff --git a/build/wheel/build_wheel.py b/build/wheel/build_wheel.py
index 8173b77e..574a9082 100644
--- a/build/wheel/build_wheel.py
+++ b/build/wheel/build_wheel.py
@@ -14,7 +14,7 @@
TEMPLATE_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "template")
IS_MAC = platform.system() == "Darwin"
-def pac... | 1 | 1 | 0 | [{"id": "G0", "claim": "The error message should include a pointer (e.g. a docs link) so a user would know how to use OPE when a backend for the type is already loaded.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
uber__neuropod__346 | uber/neuropod | 346 | defect | c5e75898186fff85fe5c2092a44523b44db5548c | 40ac56d990bba872c4d08a957ad7317cc3711cfa | Add read/write string tensor accessors | Previously accessors on string tensors were read-only.
This PR enables them to be read/write. Unfortunately, this likely isn't optimal for performance (especially for OPE), but the tradeoff makes sense given this is much more usable.
This PR also renames `set` to `copy_from` to be more clear and make string tenso... | diff --git a/source/neuropod/backends/tensorflow/tf_tensor.hh b/source/neuropod/backends/tensorflow/tf_tensor.hh
index 53ec5bc7..22139215 100644
--- a/source/neuropod/backends/tensorflow/tf_tensor.hh
+++ b/source/neuropod/backends/tensorflow/tf_tensor.hh
@@ -126,7 +126,7 @@ public:
~TensorflowNeuropodTensor() = ... | 1 | 1 | 0 | [{"id": "G0", "claim": "Please add a comment explaining the purpose of the StringProxy class.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
uber__neuropod__400 | uber/neuropod | 400 | defect | d7bf8b04922e489b8acfdf865c1ef6fd908826de | 43c78328f3aa14a34a67b3b4d60d9914a9d7be66 | [C API] Initial implementation | ### Summary:
An initial basic implementation of a C API for Neuropod.
### Test Plan:
Added a test that loads a model, runs inference, and verifies the output. More unit tests and integration tests should be added in the future
| diff --git a/source/neuropod/bindings/c/c_api_internal.h b/source/neuropod/bindings/c/c_api_internal.h
new file mode 100644
index 00000000..406da3f6
--- /dev/null
+++ b/source/neuropod/bindings/c/c_api_internal.h
@@ -0,0 +1,23 @@
+/* Copyright (c) 2020 UATC, LLC
+
+Licensed under the Apache License, Version 2.0 (the "L... | 1 | 1 | 0 | [{"id": "G0", "claim": "Headers that use std::unique_ptr or std::shared_ptr should include <memory> explicitly, in c_api_internal.h and the other C API internal headers.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}] | null |
uber__neuropod__409 | uber/neuropod | 409 | defect | 8885ab0caf7c3391013645d7c65490b1ad8724a6 | 89223ce0d9e14fb08d0c362bc203ee0c8dfa42b6 | [C API] Continue implementation | ### Summary:
Continue with basic implementation of a C API for Neuropod. Issue #407
### Test Plan:
Added a test that loads a model and fails, runs inference successfully and fails, and verifies the name and platform.
| diff --git a/source/neuropod/bindings/c/README.md b/source/neuropod/bindings/c/README.md
new file mode 100644
index 00000000..800b67fb
--- /dev/null
+++ b/source/neuropod/bindings/c/README.md
@@ -0,0 +1,7 @@
+# The C api interface:
+
+1. To build &to unit test :
+```
+bazel build // neuropod/bindings/c:c_api
+bazel te... | 9 | 8 | 3 | [{"id": "G0", "claim": "The README's example commands contain a stray space ('bazel build // neuropod/bindings/c:c_api') and should read '//neuropod/bindings/c:c_api'.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Allowing the NP_Status parameter... | null |
uber__neuropod__433 | uber/neuropod | 433 | defect | 14a7e67edfe61930e123582be26075b9efcbe8f7 | c0a06685eca5474d8808729d0ef7b8c8a9ea19d8 | Fix a bug with string tensors and OPE | ### Summary:
#397 describes a segfault that happens in certain cases when creating several string tensors and using OPE with multiple models across threads.
This PR implements a test that can reproduce the segfault a very high percentage of the time along with a fix for the root cause of the issue.
This line w... | diff --git a/source/neuropod/multiprocess/shm_tensor.hh b/source/neuropod/multiprocess/shm_tensor.hh
index 1369a68c..96a91816 100644
--- a/source/neuropod/multiprocess/shm_tensor.hh
+++ b/source/neuropod/multiprocess/shm_tensor.hh
@@ -192,9 +192,10 @@ public:
const SHMBlockID & block_id)... | 3 | 3 | 0 | [{"id": "G0", "claim": "Use size_t explicitly for the instance loop counters in the multithreaded test (size_t is the right type for counts/indices on 64-bit platforms) instead of the unsigned long/auto mix.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", ... | null |
uber__neuropod__61 | uber/neuropod | 61 | defect | a196dd3df4bb233abe65d79270e061e9ff53c3b4 | 8fdb3e0fb40396467fe3318ab37271ff3cee6a5b | Add a NeuropodTensorAllocator interface | This allows users to allocate `NeuropodTensors` without creating a `Neuropod` or a `NeuropodBackend`. | diff --git a/source/neuropods/backends/BUILD b/source/neuropods/backends/BUILD
index 4b495dba..e46c0254 100644
--- a/source/neuropods/backends/BUILD
+++ b/source/neuropods/backends/BUILD
@@ -8,6 +8,7 @@ cc_library(
name = "neuropod_backend",
srcs = [],
hdrs = [
+ "tensor_allocator.hh",
"n... | 2 | 2 | 1 | [{"id": "G0", "claim": "The lazy initialization of allocator_ in NeuropodBackendWithDefaultAllocator::get_tensor_allocator is not thread-safe; make it thread safe.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "NeuropodTensorAllocator should be desc... | null |
uber__neuropod__63 | uber/neuropod | 63 | defect | 62caafcded4373f7efe0482ba884ca2049412c84 | 547b9e26d229fee558cb20f0b6b6b1a40f786dc7 | Add NeuropodValue base type | This lets us start to support use cases where
1. The user knows they're using a specific DL framework and
2. They want to pass non-tensor types to that framework
For example we can build a child of `NeuropodValue` that lets us pass `IValues` to TorchScript | diff --git a/source/neuropods/backends/neuropod_backend.hh b/source/neuropods/backends/neuropod_backend.hh
index e05a5744..3c1dcfe5 100644
--- a/source/neuropods/backends/neuropod_backend.hh
+++ b/source/neuropods/backends/neuropod_backend.hh
@@ -22,9 +22,11 @@ namespace neuropods
// A map from a tensor name to a poin... | 2 | 1 | 0 | [{"id": "G0", "claim": "Consider not having the parent NeuropodValue know about its child type NeuropodTensor, e.g. by making the casting helper (as_tensor) a standalone function.", "category": "design", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Clarify whether the old inf... | null |
uber__okbuck__438 | uber/okbuck | 438 | defect | cdc6e2a220e2b542f3afa045e1dd2bc17aa0e50a | 27fc981fa0a9c4e7b42e8f98af329c6f8e788990 | Add empty resource rule if using resource union. | This ensures that an R file is created for that module even if there are
no resources. Gradle always generates an R file for each module even if
there are no resources. | diff --git a/app/build.gradle b/app/build.gradle
index 6dcf10538..45f5866b9 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -62,6 +62,7 @@ dependencies {
compile deps.external.xlogAndroidIdle
compile deps.apt.autoValue
+ compile project(':libraries:emptyResourceLibrary')
compile project(':li... | 2 | 2 | 0 | [{"id": "G0", "claim": "The empty android block in libraries/emptyResourceLibrary/build.gradle is unneeded and should be removed.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The me.tatarka.retrolambda plugin line in libraries/emptyResourceLib... | null |
uber__okbuck__604 | uber/okbuck | 604 | defect | 1c99dcbc0193aae5401bc7aa5ec501a5f021a1e7 | 192adb36bfc96be9ac80be6f589bf964cd3913e1 | Enable kapt support | Note that this PR depends on the [actual buck kapt support](https://github.com/facebook/buck/pull/1584) to be merged | diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle
index c8aa637e8..aa5e8e8c3 100644
--- a/buildSrc/build.gradle
+++ b/buildSrc/build.gradle
@@ -73,7 +73,7 @@ task sourcesJar(type: Jar) {
classifier = "sources"
}
-def publishVersion = "0.34.1"
+def publishVersion = "0.35.0"
group = "com.uber"
version ... | 10 | 9 | 5 | [{"id": "G0", "claim": "A test should be added to make sure that unit tests in modules with KAPT work (if one does not already exist).", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "It is unclear whether the dagger android support dependency is required... | null |
uber__okbuck__616 | uber/okbuck | 616 | defect | 6207e9507f8ccfa2e0143a63f573938867d049bb | 524ff5f0f4bdb36d59835d5a4ce78a86d5c90687 | Android libraries instrumentation apks | This PR adds the functionality to create build rules for android libraries instrumentation apks.
## Notes
* A new rule was added, `RobolectricRule` which extends from `AndroidRule`.
This way we can filter it and not add it as a dependency on instrumentation apks src rules. This was happening not only in library ... | diff --git a/buildSrc/src/main/groovy/com/uber/okbuck/composer/android/AndroidBinaryRuleComposer.groovy b/buildSrc/src/main/groovy/com/uber/okbuck/composer/android/AndroidBinaryRuleComposer.groovy
index 79ac899e0..0cfd9b75c 100644
--- a/buildSrc/src/main/groovy/com/uber/okbuck/composer/android/AndroidBinaryRuleComposer... | 8 | 7 | 4 | [{"id": "G0", "claim": "Add an integration test exercising the new library instrumentation support in one of the sample libraries.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Add a newline (blank line) after the last import in the new AndroidLibInstr... | null |
uber__okbuck__871 | uber/okbuck | 871 | defect | d20bd055dcf10919d8fda16c3d06b9839c8da747 | 1b07c46efc1833ea90a7651d51bc67fb042527e6 | Integration tests support | **Description**:
Added support for integration tests on java modules.
In order to enable it for your project, there are a few steps required:
1. Set `enableIntegrationTests` on `test` extension in okbuck
```groovy
okbuck {
<... other configs ... >
test {
enableIntegrationTests = true
}
}... | diff --git a/build.gradle b/build.gradle
index 3b1b81024..50ab402a0 100644
--- a/build.gradle
+++ b/build.gradle
@@ -180,6 +180,7 @@ okbuck {
espressoForLibraries = true
robolectric = true
robolectricApis = ["21", "27"]
+ enableIntegrationTests = true
}
wrapper {
diff --git... | 7 | 2 | 1 | [{"id": "G0", "claim": "The hasIntegrationTests detection should use `target.getIntegrationTest().getSources().isEmpty()` instead of the directory check, since the `integrationTest` configuration is not resolvable and the scope might just return an empty configuration scope.", "category": "correctness", "verdict": "sup... | null |
uber__okbuck__993 | uber/okbuck | 993 | defect | 71db285758a041f4f21936847ad6f3e6f3500c6c | 6812f51db98e0a729b431f9d6e9afff9cd044469 | Add support for setting 'labels' in prebuilt rules | In this commit, we add support for setting the 'labels' field to the template for the prebuilt macros. This allows for setting specific lables on dependencies, which can be used for validation and querying logic.
<!--
Thank you for contributing to okbuck. Before pressing the "Create Pull Request" button, please con... | diff --git a/CHANGELOG.md b/CHANGELOG.md
index b32d0a946..0c17a950d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,7 +7,7 @@
* Bug fix to handle export dependencies file path correctly.
### Version 0.53.3
-* Add configuration cleanCacheDir to conditionally delete the cache directory or
+* Add configuration cle... | 4 | 4 | 0 | [{"id": "G0", "claim": "Redundant comments restating what self-explanatory code does (apparently from AI) should be cleaned up except the straightforward ones.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The !labels.isEmpty() guard is overly ... | null |
uber__petastorm__128 | uber/petastorm | 128 | defect | 0fe1f602c6461c1a7647d3db1145a6e267f3375e | 9fc1cdba6e5d60489797db8399a190b21514b4e7 | An example of reading a dataset from pyspark | Includes three commits:
- Simpler way of getting a unischema from a dataset by url
- Remove `._common_metadata.crc` file, so a locally created dataset is readable by spark
- A hello world example : using pyspark to read from a dataset. | diff --git a/examples/hello_world/pyspark_hello_world.py b/examples/hello_world/pyspark_hello_world.py
new file mode 100644
index 000000000..dc20651c7
--- /dev/null
+++ b/examples/hello_world/pyspark_hello_world.py
@@ -0,0 +1,39 @@
+# Copyright (c) 2017-2018 Uber Technologies, Inc.
+#
+# Licensed under the Apache Lice... | 1 | 1 | 0 | [{"id": "G0", "claim": "The pull request should not use this runtime logger.warn to alert maintainers that the `rm` fallback can be removed, since that burdens users rather than the maintainers.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
uber__petastorm__182 | uber/petastorm | 182 | defect | 900e70fd7fefe5081abbe82dc5a4cf758cb2b2eb | 2429e1b37da49a822ce61ea431ba7a29873806c4 | A command line copy dataset utility | A command line utility that copies a dataset while selecting a subset of columns/rows.
| diff --git a/petastorm/benchmark/throughput.py b/petastorm/benchmark/throughput.py
index f6b710dc3..67f1eff55 100644
--- a/petastorm/benchmark/throughput.py
+++ b/petastorm/benchmark/throughput.py
@@ -15,7 +15,6 @@
import copy
import logging
-import re
import time
from collections import namedtuple
from concurre... | 2 | 2 | 0 | [{"id": "G0", "claim": "The row group size passed to materialize_dataset should probably be configurable from the command line tool instead of being hard-coded to 196.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "A comment should be added explaining th... | null |
uber__petastorm__198 | uber/petastorm | 198 | defect | 675348d5cce3dfd5a80d131eb9e2c2a344c8fcc6 | d4cd60501e2fd101e1db3ea4fbb26f4177e6d76a | Resurrect mnist examples and enabling unit tests | Trying to resolve previously observed segfaults by importing `pyarrow` before `torch` as explained here: https://github.com/selitvin/petastorm/blob/resurrect_mnist_examples/docs/troubleshoot.rst | diff --git a/.travis.yml b/.travis.yml
index 51ebb7da6..25b8bd637 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -58,21 +58,19 @@ script:
# Next pytest invoke will run boxed tests, but read the synthetic datasets from cache and not
# waste time on recreating them
+ # Tensorflow and pytorch tests confict (segfau... | 1 | 1 | 1 | [{"id": "G0", "claim": "A `store_true` argument `--no-cuda` with `default=True` can never be set to false, so either rename the option to `use-cuda` or provide two separate options for it (similar to how bops does).", "category": "design", "verdict": "supported", "priority": "P1", "scope": "introduced"}] | null |
uber__petastorm__224 | uber/petastorm | 224 | defect | 667a9f46182dade8c89f020c8d60a955b3a8b839 | 114697d2a2a9309cbee7bdda665ca1bdb0e152c6 | Initial support for S3 | Resolves #218 | diff --git a/petastorm/fs_utils.py b/petastorm/fs_utils.py
index 2929d3d23..f8eae725e 100644
--- a/petastorm/fs_utils.py
+++ b/petastorm/fs_utils.py
@@ -93,6 +93,17 @@ def __init__(self, dataset_url, hadoop_configuration=None, connector=HdfsConnect
else:
self._filesystem = connector.hdfs_c... | 2 | 2 | 0 | [{"id": "G0", "claim": "Reviewer asks whether s3fs>=0.1.6 is the minimal version needed and wants the requirement lowered to the minimal version that passes the tests, to minimize the chance of conflicting in someone else's setup.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "intr... | null |
uber__petastorm__305 | uber/petastorm | 305 | defect | 378eb833118eea9edd5fb659a46807e2f979ed28 | 6ca64fb3c15b502b0f4044fdbbe209b62f21d041 | Deprecate DataLoader transform argument | Two commits in this PR:
- Use `dill` in `exec_in_new_process.py` : allows a wider variety of types to be passed to a worker process
- Removing `transform` argument from `DataLoader`: `transform` was a 'toy' implementation which was not useful since it ran on the main thread. Now we have `transform_spec` argument in `... | diff --git a/README.rst b/README.rst
index f3cd3d990..496988f63 100644
--- a/README.rst
+++ b/README.rst
@@ -219,11 +219,14 @@ The minimalist example below assumes the definition of a ``Net`` class and
])
return (transform(mnist_row['image']), mnist_row['digit'])
- with DataLoader(make_reader('fi... | 1 | 1 | 1 | [{"id": "G0", "claim": "The PR's removal of the `transform` argument from `DataLoader` breaks `test_pytorch_dataloader_with_transform_function` in `test_pytorch_utils`, which still instantiates `DataLoader` with the `transform` argument, so the tests are failing.", "category": "correctness", "verdict": "supported", "pr... | null |
uber__petastorm__310 | uber/petastorm | 310 | defect | 3eb699c88b446a7bbacc768852b2d8ff90877b3e | 055a6a90a7c4bac4472f9aa4bd9baad1f92c7466 | #287 - fix materialize_dataset() serialization error by serializing fs factory | ## Issue
#287
## Problem
When using the `materialize_dataset()` context manager, the cleanup steps attempts to write rowgroup metadata to the generated files via `_generate_num_row_groups_per_file()`. This method attempts to serialize `pyarrow_filesystem` object, which works if the spark driver and executors refe... | diff --git a/petastorm/etl/dataset_metadata.py b/petastorm/etl/dataset_metadata.py
index f748160e9..2c089291f 100644
--- a/petastorm/etl/dataset_metadata.py
+++ b/petastorm/etl/dataset_metadata.py
@@ -98,10 +98,14 @@ def materialize_dataset(spark, dataset_url, schema, row_group_size_mb=None, use_
# After job compl... | 3 | 3 | 2 | [{"id": "G0", "claim": "materialize_dataset() should accept a filesystem factory instead of a filesystem instance, because constructing the filesystem object may require user-provided parameters and passing an instance will not work in the general case.", "category": "design", "verdict": "supported", "priority": "P1", ... | null |
uber__petastorm__322 | uber/petastorm | 322 | defect | 032e48753c923b1f4cc80ef9d9c3073f03c8307d | 12d38680673f3609bd094ccf0b79a3122c7a92f5 | ARROW-1644/1599: Excludes list inside structs fields from schema inference. | Due to this pyarrow bug, we cannot use some fields in our datasets.
However, since these fields are not always mandatory for the use case to be implemented and since data duplication would be too costly, we can afford to ignore it directly when loading the parquet file.
| diff --git a/petastorm/unischema.py b/petastorm/unischema.py
index 52fe1d752..440e60c7c 100644
--- a/petastorm/unischema.py
+++ b/petastorm/unischema.py
@@ -26,7 +26,7 @@
FloatType, DecimalType, DateType, TimestampType
from pyspark.sql.types import StructField, StructType
from six import string_types
-
+from pya... | 3 | 3 | 2 | [{"id": "G0", "claim": "The blanket `not isinstance(field_type, ListType)` guard discards valid list cases that are supported, and schema inference should be more precise instead.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "A `warnings.warn` shou... | null |
uber__petastorm__326 | uber/petastorm | 326 | defect | 982ec39eb3aa95d1e47ef229b7413ed4adca8b76 | 8942b16b705817add864d6952f01a2747388f5d8 | Convert `datetime.date` to int64 (nanosec from epoch) | `pyarrow==0.12.1` now reads parquet `DateType` columns as python datetime object.
TF does not support conversion of this native python time. We convert datetime.date column
to the number of nano-seconds since epoch in int64 to make the column into TF friendly. | diff --git a/petastorm/tests/test_tf_utils.py b/petastorm/tests/test_tf_utils.py
index 8ec20a460..082d40117 100644
--- a/petastorm/tests/test_tf_utils.py
+++ b/petastorm/tests/test_tf_utils.py
@@ -13,6 +13,8 @@
# limitations under the License.
from __future__ import division
+import datetime
+from calendar import t... | 2 | 1 | 0 | [{"id": "G0", "claim": "The vectorize object for date_to_nsec_from_epoch is constant, so it should be defined outside _sanitize_field_tf_types instead of being rebuilt for every value.", "category": "performance", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "A test with non-z... | null |
uber__petastorm__365 | uber/petastorm | 365 | defect | 4d128679fb8d96ab44d86738bcd035709e2e0f5e | 62fa06a13d94f0480e1f2e756ec79d62ebd5739c | adding regex expressions for ngrams | #332
Letting ngram take regular expressions for it's field and timestamp_field arguments.
The regex expressions are converted to unischema fields when the ngram is initialized, so it shouldn't have downstream impacts.
However, it does add an argument (schema) to NGram, so users will have to update their usag... | diff --git a/petastorm/ngram.py b/petastorm/ngram.py
index 9527c0693..146a2453a 100644
--- a/petastorm/ngram.py
+++ b/petastorm/ngram.py
@@ -13,7 +13,8 @@
# limitations under the License.
import numbers
-from petastorm.unischema import UnischemaField
+from petastorm.unischema import Unischema, UnischemaField, match... | 3 | 3 | 1 | [{"id": "G0", "claim": "Requiring a schema argument in NGram.__init__ is inconvenient because callers do not yet have the schema when constructing an NGram (and taking it from code risks desync), so regex resolution should be deferred to a resolve step that make_reader calls once it has the schema.", "category": "desig... | null |
uber__petastorm__383 | uber/petastorm | 383 | defect | 65b334473da81b53ac8839256f05ea84d8af86d8 | 53a71c7027defed30c3e7212409d815c1bcba246 | Support reading from a partitioned dataset. Interpret types of the partition-by scalars properly. Also, remove dependency on pyspark while reading using make_batch_reader. | We use pyarrow resolved types for the partition-by key (in `unischema.py`) and propagate these types to the proper configuration of UnischemaField.
This diff also removes `import pyspark` statements from the `make_petatsorm_reader` import/execution path to make sure it can be used without having pyspark installe... | diff --git a/petastorm/codecs.py b/petastorm/codecs.py
index 3f8c1db51..5544f3627 100644
--- a/petastorm/codecs.py
+++ b/petastorm/codecs.py
@@ -25,13 +25,12 @@
try:
import cv2
+
OPENCV_AVAILABLE = True
except ImportError:
OPENCV_AVAILABLE = False
import numpy as np
-from pyspark.sql.types import ... | 1 | 1 | 0 | [{"id": "G0", "claim": "In the _mock_parquet_dataset docstring, the note about the partitions parameter should be a proper comment/docstring line rather than parenthesised inline text.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
uber__petastorm__417 | uber/petastorm | 417 | defect | 64813e6d29a6ed7bb06b9bc429fbbf007e6e5544 | 9975e617b2218f8b2bac675705d95a87adf185d7 | Automatically delete columns when TransformSpec(..., removed_fields=.… | ….) is specified.
Previously, we were relying on a user to delete fields inside TransformSpec's func implementation:
```python
def delColumnA(x):
del x['columnA']
return x
transform = TransformSpec(delColumnA, removed_fields=["columnA"])
```
This assumption is non-trivial and induce additional bur... | diff --git a/petastorm/arrow_reader_worker.py b/petastorm/arrow_reader_worker.py
index e4cd31e2d..e238e4c1d 100644
--- a/petastorm/arrow_reader_worker.py
+++ b/petastorm/arrow_reader_worker.py
@@ -157,7 +157,21 @@ def _load_rows(self, pq_file, piece, shuffle_row_drop_range):
result = self._read_with_shuffle_ro... | 4 | 3 | 0 | [{"id": "G0", "claim": "Fix the 'Filteres' typo in the _select_cols docstring while working in this file.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "pre_existing"}, {"id": "G1", "claim": "In _apply_transform_spec, iterate over a keys/removed_fields intersection instead of over al... | null |
uber__petastorm__421 | uber/petastorm | 421 | defect | 71ba2baad0f50c00d1379753278ecbf08b9c9a26 | b7a618a5d89b99cded641bad9af7ee24318f82b9 | Make 'codec' and 'nullable' optional UnischemaField arguments | The goal is twofold:
- Spare users' effort of defining codec attribute for fields that are scalars and we can easily decode/encode the values ourselves.
- Make it possible for a user to skip the encoding/decoding mechanism (this is an experimental feature at the moment)
If no codec is specified, we try to deduce s... | diff --git a/petastorm/tests/test_common.py b/petastorm/tests/test_common.py
index 3034b2a9b..a3d2a4dde 100644
--- a/petastorm/tests/test_common.py
+++ b/petastorm/tests/test_common.py
@@ -22,8 +22,8 @@
import pytz
from pyspark import Row
from pyspark.sql import SparkSession
-from pyspark.sql.types import StringType... | 2 | 1 | 0 | [{"id": "G0", "claim": "The tests where the codec is inferred should explicitly compare the inferred codec against the expected codec type.", "category": "testing", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The `if not spark_type:` check in `_field_spark_dtype` should be w... | null |
uber__petastorm__495 | uber/petastorm | 495 | defect | b85d13a92f2cbdb109eb0db2336424f9197378f6 | 0b89341ea855335b13443e2419f5ea722ee81581 | Fix spurious legacy-regex rule warning | The warning was occuring when both legacy and the new rule produced the
same overall set of fields, but maybe in different order. Although, both
rules would behave the same from the user perspective, they would see a
warning. The warning would be bogus because it wouldn't contain any
field names. | diff --git a/petastorm/tests/test_unischema.py b/petastorm/tests/test_unischema.py
index 4f30a444e..20a8cad3c 100644
--- a/petastorm/tests/test_unischema.py
+++ b/petastorm/tests/test_unischema.py
@@ -313,6 +313,11 @@ def test_match_unischema_fields_legacy_warning():
with pytest.warns(UserWarning, match=r'schema_f... | 1 | 1 | 0 | [{"id": "G0", "claim": "In the else branch, match_unischema_fields should return [] rather than field_regex.", "category": "correctness", "verdict": "supported", "priority": "P3", "scope": "introduced"}] | null |
uber__petastorm__503 | uber/petastorm | 503 | defect | a61fe13d5932f9bb9ff6a9e7fa8b7c2dfd5016e3 | 7bd30d9b309d3435c330d5edc437bbbaff9ec9ff | Make petastorm reader support dataset url list. | Currently, `make_batch_reader` and `make_reader` only accept a directory as a dataset url, but sometimes we need specify parquet file list as input, the reason is:
* We may want to use petastorm on aws S3, but S3 only provide eventually consistency for dir list operation (it is unreliable). So that, for S3 we need s... | diff --git a/petastorm/arrow_reader_worker.py b/petastorm/arrow_reader_worker.py
index 0b4247b33..a99d0416e 100644
--- a/petastorm/arrow_reader_worker.py
+++ b/petastorm/arrow_reader_worker.py
@@ -87,7 +87,7 @@ def __init__(self, worker_id, publish_func, args):
super(ArrowReaderWorker, self).__init__(worker_id... | 9 | 9 | 4 | [{"id": "G0", "claim": "The docstring of get_schema_from_dataset_url should be updated to reflect the parameter's new meaning (it now accepts a url or a list of urls), not just left as 'A dataset URL'.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim":... | null |
uber__petastorm__506 | uber/petastorm | 506 | defect | e3acecf06618b14876fe8f391197125d61dde253 | cf06a878366a85c213dfcf7fcf9f1f3f37a20d81 | Simplify data conversion from Spark to TensorFlow: support tensorflow dataset advance arguments | ## What changes are proposed in this PR?
Add `converter.make_tf_dataset()` with advanced params.
## API
~~~python
class SparkDatasetConverter(object):
"""
A `SparkDatasetConverter` object holds one materialized spark dataframe and
can be used to make one or more tensorflow datasets or torch dataloa... | diff --git a/petastorm/spark/spark_dataset_converter.py b/petastorm/spark/spark_dataset_converter.py
index a1bbaeaf6..05ef4e89c 100644
--- a/petastorm/spark/spark_dataset_converter.py
+++ b/petastorm/spark/spark_dataset_converter.py
@@ -18,7 +18,9 @@
import datetime
import uuid
import logging
+import os
import warn... | 11 | 11 | 2 | [{"id": "G0", "claim": "Add a docstring to the new get_env_rank_and_size function.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Change the workers_count default to None to reserve autotuning for the future, and mention the current default in the... | null |
uber__petastorm__513 | uber/petastorm | 513 | defect | 0b70510bf79b05d2e4b6ffd8897a461d7d0fb99a | a2fac510217dca0d84c37f68d88d6413bc31f3cb | [ML-10118] Preserve spark dataframe schema order when create petastorm dataset/dataloader | * Preserve spark dataframe schema order when create petastorm dataset/dataloader
* Add selected fields for `TransformSpec` | diff --git a/petastorm/reader.py b/petastorm/reader.py
index 35b854e9e..fcf1f726e 100644
--- a/petastorm/reader.py
+++ b/petastorm/reader.py
@@ -206,6 +206,11 @@ def make_batch_reader(dataset_url_or_urls,
NOTE: only scalar columns are currently supported.
+ NOTE: If without `schema_fields` specified, the re... | 6 | 4 | 1 | [{"id": "G0", "claim": "The NOTE in make_batch_reader's docstring saying only scalar columns are currently supported seems outdated.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "An error should be raised if selected_fields contains field names t... | null |
uber__petastorm__514 | uber/petastorm | 514 | defect | 0b70510bf79b05d2e4b6ffd8897a461d7d0fb99a | 944c599132f312e74acfba9c5d4601714628aa65 | [ML-9743] Address S3 eventually consistency issue on S3-like filesystem | For some filesystem like aws S3, there's an eventually consistency issue: after we materialized dataframe as parquet files, when use petastorm reader, the file may not be available immediately. We need wait at most 30 seconds to make sure all files are available. This is caused by S3 list operation eventually consisten... | diff --git a/petastorm/spark/spark_dataset_converter.py b/petastorm/spark/spark_dataset_converter.py
index 92f641860..03ccc41be 100644
--- a/petastorm/spark/spark_dataset_converter.py
+++ b/petastorm/spark/spark_dataset_converter.py
@@ -19,15 +19,17 @@
import uuid
import logging
import os
+import time
import warnin... | 8 | 7 | 2 | [{"id": "G0", "claim": "Add logger.debug statements to the filesystem-wait function so a user can tell why the app appears to hang.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Add a unit test for the wait-for-filesystem-consistency function, ... | null |
uber__petastorm__517 | uber/petastorm | 517 | defect | 0b70510bf79b05d2e4b6ffd8897a461d7d0fb99a | b7f55cc41980984d9e8864b27f9626f39bda99d5 | [ML-10156] Fix array type field inferred shape | I set the inferred shape for array type field to be `(None,)` instead of `()`.
This will address issues on tensorflow dataset.
Test code:
```
import os
import pandas as pd
import sys
import numpy as np
from pyspark.sql.functions import pandas_udf
import tensorflow as tf
from petastorm import make_batch_re... | diff --git a/petastorm/tests/test_tf_utils.py b/petastorm/tests/test_tf_utils.py
index 99018e734..eacb2dfc1 100644
--- a/petastorm/tests/test_tf_utils.py
+++ b/petastorm/tests/test_tf_utils.py
@@ -284,9 +284,15 @@ def test_simple_read_tensorflow_with_parquet_dataset(scalar_dataset):
data"""
with make_batch_re... | 2 | 1 | 0 | [{"id": "G0", "claim": "With this PR, for an array field the reader generates a tensorflow dataset field with shape (?, ?), so running a keras model.fit without manually setting the field shape may still fail with a ValueError about the Dense last dimension being undefined.", "category": "design", "verdict": "uncertain... | null |
uber__petastorm__521 | uber/petastorm | 521 | defect | 4a99b9b84c3f7b09f42803e9535366be8068321e | 71d80e0057d1957bb3a1204472da2011f3d0e4c0 | Add a build in CI for pyspark 3.0 | The pypi package is not released yet. Once it is available, I'll update the code. | diff --git a/.travis.yml b/.travis.yml
index d93c88b6d..0a886f588 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,10 +17,11 @@ language: python
python:
- '2.7'
env:
- - PYARROW_VERSION=0.12.1 TF_VERSION=1.12 DEPLOYABLE=0 PY=2.7
- - PYARROW_VERSION=0.15.1 TF_VERSION=1.12 DEPLOYABLE=0 PY=2.7
- - PYARROW_VERSION... | 2 | 2 | 1 | [{"id": "G0", "claim": "The PYSPARK_VERSION condition in .travis.yml should compare against \"3\" rather than 2.4.5; string comparison of versions is not ideal but acceptable since this is temporary.", "category": "correctness", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Bu... | null |
uber__petastorm__525 | uber/petastorm | 525 | defect | b425e435a5004d56d2618021d9e12fb88b939810 | ddba6cd469e22e65fe5c55b95d60f58ed486b190 | [ML-10160] Refine Spark dataset converter warning logs. | * Warn users if the intermediate file sizes are too small (<50mb)
* Warn users if set wrong parent cache dir. (Only in databricks environment) | diff --git a/petastorm/spark/spark_dataset_converter.py b/petastorm/spark/spark_dataset_converter.py
index 90a0c5c3e..524bdbc6e 100644
--- a/petastorm/spark/spark_dataset_converter.py
+++ b/petastorm/spark/spark_dataset_converter.py
@@ -65,7 +65,7 @@ def _get_parent_cache_dir_url():
"application."
... | 9 | 9 | 3 | [{"id": "G0", "claim": "The `_check_url()` call inside `_check_parent_cache_dir_url` could be inlined instead of calling the helper.", "category": "maintainability", "verdict": "supported", "priority": "P3", "scope": "introduced"}, {"id": "G1", "claim": "The low-median-size warning should also require the total number ... | null |
uber__petastorm__528 | uber/petastorm | 528 | defect | fbfad23f875617f4397d84531251a66d801c799f | cc34dd1ed3fb493e852f9914d59d47b3f13c522e | Replace deprecated Schema.add_metadata with Schema.with_metadata call. | No functionality change as we can see from:
```python
def add_metadata(self, metadata):
warnings.warn("The 'add_metadata' method is deprecated, use "
"'with_metadata' instead", FutureWarning, stacklevel=2)
return self.with_metadata(metadata)
```
Our CI does not test al... | diff --git a/petastorm/compat.py b/petastorm/compat.py
index a0f64275f..bdc64d058 100644
--- a/petastorm/compat.py
+++ b/petastorm/compat.py
@@ -64,3 +64,10 @@ def compat_make_parquet_piece(path, open_file_func, **kwargs):
else:
return pq.ParquetDatasetPiece(path, open_file_func=open_file_func, # pylint:... | 1 | 1 | 0 | [{"id": "G0", "claim": "The deprecated arrow_schema.field_by_name call (deprecated in pyarrow 0.15) should also be updated, as it was done for Schema.add_metadata.", "category": "maintainability", "verdict": "supported", "priority": "P1", "scope": "pre_existing"}] | null |
uber__petastorm__530 | uber/petastorm | 530 | defect | a76817902c7083369ce90f78e18b339b7867d929 | d0bc6eb8f6d87a0e6326ce713a07113e4e585020 | Add spark dataset converter mnist example scripts | There are 2 end-to-end examples in `examples/spark_dataset_converter/`:
* tensorflow_converter_example.py: A simple MLP model is trained locally and on a spark worker.
* pytorch_converter_example.py: A CNN model is trained locally and on a spark worker.
These examples are tested in `examples/spark_dataset_converte... | diff --git a/.travis.yml b/.travis.yml
index 9009f59cb..6ef187a45 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -21,7 +21,7 @@ env:
- ARROW_PRE_0_15_IPC_FORMAT=1 PYARROW_VERSION=0.15.1 TF_VERSION=1.12 DEPLOYABLE=0 PY=2.7 PYSPARK_VERSION=2.4.4
- PYARROW_VERSION=0.12.1 TF_VERSION=1.13.2 DEPLOYABLE=0 PY=3.7 PYSPARK_... | 9 | 9 | 1 | [{"id": "G0", "claim": "The comment calling /tmp/petastorm/mnist a DBFS FUSE path is wrong; it should say the path must be accessible by both Spark workers and driver.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "TensorFlow should be imported in... | null |
uber__petastorm__536 | uber/petastorm | 536 | defect | c7b84759fc715087d0692483dea9191b9dd9ba7c | d22607ff040731eeb068da5faa456e698c377d5f | CI with Tensorflow 2.1 | Now CI run on following env:
- PYARROW_VERSION=0.12.1 TF_VERSION=1.15.0 DEPLOYABLE=0 PY=2.7 PYSPARK_VERSION=2.4.4
- PYARROW_VERSION=0.15.1 TF_VERSION=1.15.0 DEPLOYABLE=0 PY=2.7 PYSPARK_VERSION=2.4.4 ARROW_PRE_0_15_IPC_FORMAT=1
- PYARROW_VERSION=0.12.1 TF_VERSION=1.15.0 DEPLOYABLE=0 PY=3.7 PYSPARK_VERSION=2.4.4... | diff --git a/.travis.yml b/.travis.yml
index 6ef187a45..7d5702a3f 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -17,11 +17,12 @@ language: python
python:
- '2.7'
env:
- - PYARROW_VERSION=0.12.1 TF_VERSION=1.12 DEPLOYABLE=0 PY=2.7 PYSPARK_VERSION=2.4.4
- - ARROW_PRE_0_15_IPC_FORMAT=1 PYARROW_VERSION=0.15.1 TF_VER... | 7 | 6 | 2 | [{"id": "G0", "claim": "Since tensorflow.compat.v1 was introduced in TF 1.14, the PR drops support for TF < 1.14, and if that is the new minimum setup.py should be updated to require tensorflow>=1.14.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "T... | null |
uber__petastorm__537 | uber/petastorm | 537 | defect | fbfad23f875617f4397d84531251a66d801c799f | c6a506dd78cff8c1c7a5226928d41043782f0257 | Fix bug: respect dynamically changed parent cache dir conf | Bug: If we execute the following code:
```python
spark.conf.set("petastorm.spark.converter.parentCacheDirUrl", "file:///url1")
converter1 = make_spark_converter(df) # This works fine.
# Change conf
spark.conf.set("petastorm.spark.converter.parentCacheDirUrl", "file:///url2")
converter2 = make_spark_converter(df... | diff --git a/petastorm/spark/spark_dataset_converter.py b/petastorm/spark/spark_dataset_converter.py
index a9861cce9..e3571298d 100644
--- a/petastorm/spark/spark_dataset_converter.py
+++ b/petastorm/spark/spark_dataset_converter.py
@@ -384,7 +384,7 @@ def _get_df_plan(df):
class CachedDataFrameMeta(object):
- ... | 3 | 3 | 1 | [{"id": "G0", "claim": "parent_cache_dir_url should be normalized (e.g. with normalize_dataset_url) before the cache-hit comparison, so equivalent URLs compare equal.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "normalize_dataset_url should be mov... | null |
uber__petastorm__540 | uber/petastorm | 540 | defect | 43494ec2a9168200e499a1de94633fe9c6f1544f | 9ca3bebba9cfe050b4017423f23d1d62ea1f7249 | New PyTorch BatchedDataLoader implementation using batched operations | The current DataLoader implementation relies on python iteration over individual rows of a parquet dataset. This is reasonable for small datasets but runs into throughput limitations:
Previous timing:
```
Samples per second for batch 10: 7.556e+04
Samples per second for batch 100: 1.001e+05
Samples per second fo... | diff --git a/petastorm/etl/dataset_metadata.py b/petastorm/etl/dataset_metadata.py
index b44d2e921..39c811f34 100644
--- a/petastorm/etl/dataset_metadata.py
+++ b/petastorm/etl/dataset_metadata.py
@@ -378,7 +378,7 @@ def get_schema_from_dataset_url(dataset_url_or_urls, hdfs_driver='libhdfs3'):
"""
fs, path_or... | 20 | 16 | 0 | [{"id": "G0", "claim": "Loading samples into the shuffling buffer in a separate thread could be faster than doing it inside the same read loop that returns the batch.", "category": "performance", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The copyright header of the new pytor... | null |
uber__petastorm__542 | uber/petastorm | 542 | defect | dd87ee630f2f1dfef5200fb854c639134652e209 | caaaafeb6d5e77d4ccd8d6a197b469bf4cda885c | Address several autograph failed issues for TF2 | Currently, for some function, TF2 autograph will fail.
See
https://github.com/tensorflow/tensorflow/issues/35765
https://github.com/tensorflow/tensorflow/issues/30149
https://github.com/tensorflow/autograph/issues/3
If autograph failed, the functions will be run eagerly and TF cannot optimize them. So we'd bette... | diff --git a/.travis.yml b/.travis.yml
index 2e88ef109..92a91591d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -82,12 +82,14 @@ script:
--ignore=examples/mnist/tests/test_pytorch_mnist.py
--ignore=petastorm/tests/test_pytorch_utils.py
--ignore=petastorm/tests/test_pytorch_dataloader.py
+ --ignore=pet... | 4 | 4 | 3 | [{"id": "G0", "claim": "A test should be added to make sure autograph is not broken going forward.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Do not rename _get_namedtuple to get_namedtuple; the rename is not needed for this PR.", "category": "desig... | null |
uber__petastorm__555 | uber/petastorm | 555 | defect | 444d3cb240834c10d430ebcb0f3c06cff4ab3ce1 | c44c01cacaee3ca597602745d533983d0feeef89 | In-memory cache | This PR adds a in-memory cache to the Petastorm loader. This enables very fast reading of data and removing the IO/netowrk bottleneck. | diff --git a/petastorm/pytorch.py b/petastorm/pytorch.py
index 8a9d8f14c..6566bbc0b 100644
--- a/petastorm/pytorch.py
+++ b/petastorm/pytorch.py
@@ -14,17 +14,21 @@
import collections
import decimal
+import logging
# Must import pyarrow before torch. See: https://github.com/uber/petastorm/blob/master/docs/troubles... | 18 | 14 | 1 | [{"id": "G0", "claim": "The `_done_adding` attribute is not used in `BatchedShufflingBufferBase` and makes the base class aware of subclass implementation details, so it should be defined in the class that uses it.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G2", "c... | null |
uber__petastorm__563 | uber/petastorm | 563 | defect | ed6c9db6fa524cb41e2de2cf3be529b0d40305e8 | ef0478bb83fe730deae630da7df7a5b3bec39a52 | Use mypy in our CI script | Using mypy to run static type checking as part of travis build
Fixed some issues causing mypy to fail:
- Upgraded minimal torch and Pillow versions in `setup.py`
- Upgraded torch and Pillow in `.travis.yml`. This is a quick fix. A proper better way is to upgrade docker image used for the build.
- Rely on `unittes... | diff --git a/.travis.yml b/.travis.yml
index 76a86d53e..2ac379b80 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -57,10 +57,15 @@ before_script:
- $RUN pip install --upgrade numpy
- $RUN pip install -U pyarrow==${PYARROW_VERSION} tensorflow==${TF_VERSION}
+
+ # TODO(yevgeni): need to update docker build image a... | 3 | 1 | 0 | [{"id": "G0", "claim": "Questions whether mypy.ini should globally set ignore_missing_imports = True, asking if there is a particular case where missing imports cause a false positive that justifies it.", "category": "design", "verdict": "uncertain", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The ... | null |
uber__petastorm__568 | uber/petastorm | 568 | defect | 1ed3f60c9177171c1bb778f1a5be972d4f5c1d07 | e42bfc6c888b7e6d3cf14e0ade3db45bf97568b2 | Added additional kwargs for Spark Dataset Converter | Adds support for:
- Shuffling
- Custom data loaders | diff --git a/petastorm/spark/spark_dataset_converter.py b/petastorm/spark/spark_dataset_converter.py
index 95559fcfa..e93991480 100644
--- a/petastorm/spark/spark_dataset_converter.py
+++ b/petastorm/spark/spark_dataset_converter.py
@@ -200,6 +200,8 @@ def make_tf_dataset(
prefetch=None,
num_e... | 3 | 3 | 1 | [{"id": "G0", "claim": "If `shuffle_buffer_size` (added to `make_tf_dataset`) is effectively the same as `shuffling_queue_capacity` in `make_torch_dataloader`, the two parameters should be called the same name.", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim... | null |
uber__petastorm__611 | uber/petastorm | 611 | defect | 4fe92a4ce9ee3a6028a17f08fc18295d3c587d3c | 22d9f1a67e5352587fcf13e6926e51f4396e5a94 | Bugfix: S3FSWrapper is deprecated at s3fs 0.5.0 | Enforce the minimal s3fs version at which S3FSWrapper is not needed. Fixes #609. | diff --git a/petastorm/fs_utils.py b/petastorm/fs_utils.py
index 98edfaf0a..a0374419b 100644
--- a/petastorm/fs_utils.py
+++ b/petastorm/fs_utils.py
@@ -138,9 +138,9 @@ def __init__(self, dataset_url, hadoop_configuration=None, connector=HdfsConnect
raise ValueError('URLs must be of the form s3://bucke... | 1 | 1 | 0 | [{"id": "G0", "claim": "The pull request should add an entry for itself to the release notes.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
uber__petastorm__634 | uber/petastorm | 634 | defect | 6c64a37e80d41f2565866db9c2d0df4cb5a958af | 0f6a52b27fab9db6f879cdb1b11167f0172bba72 | Raise an explicit error when TransformSpec is given a shape with a variable dimension | Records returned by `make_batch_reader` are returned as a dictionary of coalesced numpy arrays. In order to properly batch multiple rows together, all fields must have the same dimension. If a user passes an shape that have some variable dimensions, multiple rows won't coalesce properly.
This PR issues a clear messa... | diff --git a/petastorm/arrow_reader_worker.py b/petastorm/arrow_reader_worker.py
index bdac668e7..d61cef5c5 100644
--- a/petastorm/arrow_reader_worker.py
+++ b/petastorm/arrow_reader_worker.py
@@ -173,6 +173,10 @@ def process(self, piece_index, worker_predicate, shuffle_row_drop_partition):
def _check_shape_and_ra... | 2 | 1 | 0 | [{"id": "G0", "claim": "The new shape guard should also check for a -1 dimension, in case a variable dimension is denoted by -1 rather than None.", "category": "correctness", "verdict": "opposed", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The comparison should use `x.shape != tuple(field.shape)`,... | null |
uber__petastorm__662 | uber/petastorm | 662 | defect | 10e0fc8655150afdcf4dbd9ac67dcfb2ccbb18d9 | cf6f5e74c75cd8d18ff0223ccbb9c060b210eb96 | Reader: shuffle row groups before sharding. | Splitting row groups by % num_shards is not a good idea to split data.
This commit introduce a shard_seed parameter to random shuffle row
groups before sharding. | diff --git a/petastorm/reader.py b/petastorm/reader.py
index 81578ab8..8670e273 100644
--- a/petastorm/reader.py
+++ b/petastorm/reader.py
@@ -337,7 +337,7 @@ def __init__(self, pyarrow_filesystem, dataset_path, schema_fields=None,
shuffle_row_groups=True, shuffle_row_drop_partitions=1,
... | 4 | 4 | 2 | [{"id": "G0", "claim": "Seeding the global random module may unexpectedly affect other parts of the system; instead instantiate a dedicated Random instance with the seed and shuffle from it.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Since shard... | null |
uber__petastorm__665 | uber/petastorm | 665 | defect | e89a7fef5c46e379c1b42cd545c8ab6bb9fd3948 | d703ef17a1b350195867a001d68374f3aa73b47e | Replaced s3 and gcs connectors with fsspec to support additional filesystems | [fsspec](https://filesystem-spec.readthedocs.io/en/latest/intro.html) is a library used by Pandas and Dask to enable reading and writing to arbitrary filesystems (see [here](https://github.com/intake/filesystem_spec/blob/master/fsspec/registry.py#L88) for a list of filesystems supported out of the box).
One of the k... | diff --git a/petastorm/etl/dataset_metadata.py b/petastorm/etl/dataset_metadata.py
index b8b457edc..77c192ca3 100644
--- a/petastorm/etl/dataset_metadata.py
+++ b/petastorm/etl/dataset_metadata.py
@@ -385,18 +385,18 @@ def get_schema(dataset):
return schema
-def get_schema_from_dataset_url(dataset_url_or_urls,... | 1 | 1 | 0 | [{"id": "G0", "claim": "Add porting instructions to docs/release_notes.rst explaining what users of the replaced s3/gcs connectors must change.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}] | null |
uber__petastorm__669 | uber/petastorm | 669 | defect | 7f37e8dde6ff1b13f055d22a6289e2de8bb5d473 | bbb04b9ec7fa3a34b18a6f07237a73501d7edea5 | Pytorch: add inmemory batched dataloader | Including two changes:
- Remove current inmem_cache option for pytorch batched dataloader
- Create a new class for inmemory batched dataloader
Related to #664 | diff --git a/petastorm/pytorch.py b/petastorm/pytorch.py
index f8f753b83..c45ad3170 100644
--- a/petastorm/pytorch.py
+++ b/petastorm/pytorch.py
@@ -16,7 +16,6 @@
import decimal
# Must import pyarrow before torch. See: https://github.com/uber/petastorm/blob/master/docs/troubleshoot.rst
import re
-import sys
import ... | 11 | 11 | 3 | [{"id": "G0", "claim": "The attributes assigned in InMemBatchedDataLoader.__init__ should not be advertised as public but marked with a leading underscore.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "The buffer copy loop should use `i` instea... | null |
uber__petastorm__674 | uber/petastorm | 674 | defect | 211600bdea5310c9255d7485f7cea5d113e68c8a | 708730e11858da0a983ab9fd159b66813cb150dd | tf_dataset: add unit test to verify repeat() works after cache() | We can cache first iteration result then use repeat() to do multiple
epochs. | diff --git a/docs/release-notes.rst b/docs/release-notes.rst
index fa7befb8..1d873571 100644
--- a/docs/release-notes.rst
+++ b/docs/release-notes.rst
@@ -6,6 +6,7 @@ Release notes
Release 0.10.1 (unreleased)
===========================
+- `PR 674 <https://github.com/uber/petastorm/pull/674>`_: tf_dataset: add unit... | 2 | 2 | 0 | [{"id": "G0", "claim": "The tests should probably move to the modern TF interface (import tensorflow.compat.v1 as tf) so they work with eager execution and become less bloated, raised as future work and explicitly not for this PR.", "category": "maintainability", "verdict": "supported", "priority": "P2", "scope": "pre_... | null |
uber__petastorm__687 | uber/petastorm | 687 | defect | 7cda582a50c276c99cbeb0405675f103b6765d33 | fcaf7c8ef7993cb0dede339d9272fb36f77aa32e | Fix a failure when reading data from a parquet file (and not a parquet directory) |
Code was crashing since ParquetDataset's (pyarrow) partition_names attribute was set to None when the ParquetDataset object instance was created from a parquet file and not parquet directory. | diff --git a/docs/release-notes.rst b/docs/release-notes.rst
index c43ee511..150bf954 100644
--- a/docs/release-notes.rst
+++ b/docs/release-notes.rst
@@ -6,6 +6,9 @@ Release notes
Release 0.11.1 (unreleased)
===========================
+- `PR 687 <https://github.com/uber/petastorm/pull/687>`_ (resolves issue
+ `#... | 1 | 1 | 1 | [{"id": "G0", "claim": "The new test function is named test_simple_read, duplicating the name of the existing test at line 68, which makes the unit test fail; the test name should be fixed.", "category": "correctness", "verdict": "supported", "priority": "P0", "scope": "introduced"}] | null |
uber__petastorm__767 | uber/petastorm | 767 | defect | 3f248003221a648261a36189c95c8705f6ef34ad | 213f4a3f5af04c5b2f18ea75d149116871494d0e | Reader: enable shuffling inside every row group | - Allow shuffle inside every single row group in reader.
- Also use a shuffle seed to generate reproducible shuffle results across: single row shuffle, row groups shuffle in ventilator and sharding. | diff --git a/petastorm/arrow_reader_worker.py b/petastorm/arrow_reader_worker.py
index 9e6ffe51..9ab785b2 100644
--- a/petastorm/arrow_reader_worker.py
+++ b/petastorm/arrow_reader_worker.py
@@ -100,6 +100,8 @@ def __init__(self, worker_id, publish_func, args):
self._transform_spec = args[6]
self._tra... | 5 | 4 | 2 | [{"id": "G0", "claim": "Seeding the global numpy RNG with np.random.seed in the worker may conflict with other users of the random generator on this or other threads; create a seeded np.random.RandomState and use it instead.", "category": "correctness", "verdict": "supported", "priority": "P1", "scope": "introduced"}, ... | null |
uber__petastorm__783 | uber/petastorm | 783 | defect | 170b22a18ee1c0346d2b289f096804e34a0c5d25 | 61a78055b4d00b4c948c9f8b0e15b8487c315a9b | Support results_queue_size parameter in make_batch_reader api | The default results_queue_size used in make_batch_reader is 50. This will lead to OOM exception while loading big datasets with thread reader pool type. By exposing results_queue_size parameter via make_batch_reader api, the user is able to control the prefetched data size which in turns will help to alleviate OOM issu... | diff --git a/petastorm/reader.py b/petastorm/reader.py
index e700a7d8..8fa69935 100644
--- a/petastorm/reader.py
+++ b/petastorm/reader.py
@@ -205,6 +205,7 @@ def make_reader(dataset_url,
def make_batch_reader(dataset_url_or_urls,
schema_fields=None,
reader_pool_type='thre... | 2 | 2 | 1 | [{"id": "G0", "claim": "Add a unittest (e.g. peeking into the queue's member variable, in tests/test_parquet_reader.py) to check that the results_queue_size parameter is propagated properly.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Add a line to d... | null |
uber__petastorm__787 | uber/petastorm | 787 | defect | 42f4af9ed65a6d15f143997c59d697ae27a86e76 | a9d1d82282cd686bbaf04cbf7d117e99fda859e8 | Make `make_spark_converter` supports creating converter from a saved dataframe path | Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
Make `make_spark_converter` supports creating converter from a saved dataframe path.
In this case, we can skip the step of materializing spark dataframe that might be slow. | diff --git a/petastorm/spark/spark_dataset_converter.py b/petastorm/spark/spark_dataset_converter.py
index e0e473d9..9b20a558 100644
--- a/petastorm/spark/spark_dataset_converter.py
+++ b/petastorm/spark/spark_dataset_converter.py
@@ -454,6 +454,22 @@ def _check_url(dir_url):
'Please prepend "file://" for ... | 3 | 2 | 1 | [{"id": "G0", "claim": "Add a unit test for the new _normalize_databricks_dbfs_url function, which should be straightforward to write.", "category": "testing", "verdict": "supported", "priority": "P1", "scope": "introduced"}, {"id": "G1", "claim": "Add a line about this pull request to the release notes.", "category": ... | null |
uber__piranha__348 | uber/piranha | 348 | defect | 443b8785787dd1793ac1e12a89329451890144e9 | daeece38fedb5d81f0e0891709654d28f96e7c84 | Added rules for boolean_simplification of something_and_false and false_and_something | Rules added:
1. `abc && false => false`
2. `false && abc => false` | diff --git a/src/cleanup_rules/swift/rules.toml b/src/cleanup_rules/swift/rules.toml
index 405c3d1fd..cd5d94363 100644
--- a/src/cleanup_rules/swift/rules.toml
+++ b/src/cleanup_rules/swift/rules.toml
@@ -94,6 +94,48 @@ groups = ["boolean_expression_simplify"]
replace_node = "disjunction_expression"
replace = "true"
... | 2 | 2 | 0 | [{"id": "G0", "claim": "The `some_identifier_and_false` rule should carry a comment explaining its intuition — that it only applies when the lhs of the conjunction is a plain identifier, since other expressions (method invocations etc.) could have side effects and are not simplified.", "category": "documentation", "ver... | null |
uber__piranha__386 | uber/piranha | 386 | defect | 0d40c87ee5c78f5a05e52deba23dffef369a6d9e | 2949125946569f911ff17fcc716530f2cc5cd1c1 | Bug/Feature: Handle syntactically incorrect input trees | We**Background**: Currently Piranha accepts syntactically correct code, and panics when an applied a rule creates syntactically incorrect code.
**Feature**: We want to allow Piranha to operate over partially correct ASTs when the user passes the option `--allow-dirty-ast` . We want this feature because it will (i) ... | diff --git a/src/models/source_code_unit.rs b/src/models/source_code_unit.rs
index c93e7a505..0e89be730 100644
--- a/src/models/source_code_unit.rs
+++ b/src/models/source_code_unit.rs
@@ -339,9 +339,12 @@ impl SourceCodeUnit {
// Get the tree_sitter's input edit representation
let (new_source_code, ts_edit) ... | 3 | 2 | 0 | [{"id": "G0", "claim": "The new syntax-error tolerance behaviour should be configurable from the command line (e.g. an --allow-dirty-tree flag).", "category": "design", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim": "Drop the definite article in the new tests' doc comments ('Thi... | null |
uber__piranha__392 | uber/piranha | 392 | defect | efc58bcdc950193c81766d773271c4b3c9468439 | 1db7fa3b2632b94c9dd92f71d34bb89e5075a090 | Fix go comments bug | **Bug Diagnosis** (#376): This problem is only in`Go` (because of its grammar, in my observation). The problem is caused when the comment is associated to the last statement of a method body in `Go`. Diagnosis:
Our comment fetching [algorithm](https://github.com/uber/piranha/blob/8edb8dbdc6da2c704efddc6894c7dcbf1104... | diff --git a/src/models/language.rs b/src/models/language.rs
index d8265c1f0..0e9fb6053 100644
--- a/src/models/language.rs
+++ b/src/models/language.rs
@@ -15,7 +15,7 @@ use std::str::FromStr;
use getset::Getters;
use serde_derive::Deserialize;
-use tree_sitter::{Parser, Query};
+use tree_sitter::{Node, Parser, Qu... | 4 | 3 | 0 | [{"id": "G0", "claim": "The stale comments in the Go test fixtures (\"this comment doesnt get removed\") no longer describe the actual behaviour and should be updated, as should the similar cases below.", "category": "documentation", "verdict": "supported", "priority": "P2", "scope": "introduced"}, {"id": "G1", "claim"... | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.