Skip to content

Commit

Permalink
discojs/AsyncInformant: unused
Browse files Browse the repository at this point in the history
  • Loading branch information
tharvik committed Jul 22, 2024
1 parent e26885f commit 7730c4a
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 137 deletions.
9 changes: 1 addition & 8 deletions discojs/src/aggregator/base.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Map, Set } from 'immutable'

import type { client, AsyncInformant } from '../index.js'
import type { client } from '../index.js'

import { EventEmitter } from '../utils/event_emitter.js'

Expand Down Expand Up @@ -31,8 +31,6 @@ export abstract class Base<T> extends EventEmitter<{'aggregation': T }> {
// communication round -> NodeID -> T
protected contributions: Map<number, Map<client.NodeID, T>>

protected informant?: AsyncInformant<T>

/**
* The current aggregation round, used for assessing whether a node contribution is recent enough
* or not.
Expand Down Expand Up @@ -82,10 +80,6 @@ export abstract class Base<T> extends EventEmitter<{'aggregation': T }> {
*/
abstract aggregate (): void

registerObserver (informant: AsyncInformant<T>): void {
this.informant = informant
}

/**
* Returns whether the given round is recent enough, dependent on the
* aggregator's round cutoff.
Expand Down Expand Up @@ -178,7 +172,6 @@ export abstract class Base<T> extends EventEmitter<{'aggregation': T }> {
this._round++
this.contributions = Map()
}
this.informant?.update()
}

/**
Expand Down
1 change: 0 additions & 1 deletion discojs/src/aggregator/mean.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ export class MeanAggregator extends Aggregator<WeightsContainer> {

this.contributions = this.contributions.setIn([0, nodeId], contribution);

this.informant?.update();
if (this.isFull()) this.aggregate();

return true;
Expand Down
1 change: 0 additions & 1 deletion discojs/src/aggregator/secure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ export class SecureAggregator extends Aggregator<WeightsContainer> {
contribution,
);

this.informant?.update();
if (this.isFull()) this.aggregate();

return true;
Expand Down
68 changes: 0 additions & 68 deletions discojs/src/async_informant.spec.ts

This file was deleted.

51 changes: 0 additions & 51 deletions discojs/src/async_informant.ts

This file was deleted.

1 change: 0 additions & 1 deletion discojs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ export * as client from './client/index.js'
export * as aggregator from './aggregator/index.js'

export { WeightsContainer, aggregation } from './weights/index.js'
export { AsyncInformant } from './async_informant.js'
export { Logger, ConsoleLogger } from './logging/index.js'
export { Memory, type ModelInfo, type Path, type ModelSource, Empty as EmptyMemory } from './memory/index.js'
export { Disco, RoundLogs } from './training/index.js'
Expand Down
8 changes: 1 addition & 7 deletions server/src/router/federated/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ import type {
MetadataValue
} from '@epfml/discojs'
import {
aggregator as aggregators,
client,
serialization,
AsyncInformant,
aggregator as aggregators,
} from '@epfml/discojs'

import { Server } from '../server.js'
Expand Down Expand Up @@ -50,10 +49,6 @@ export class Federated extends Server {
* with the most recent result.
*/
private results = Map<TaskID, Promise<WeightsContainer>>()
/**
* Training informants for each hosted task.
*/
private informants = Map<TaskID, AsyncInformant<WeightsContainer>>()
/**
* Contains metadata used for training by clients for a given task and round.
* Stored by task id, round number, node id and metadata key.
Expand Down Expand Up @@ -113,7 +108,6 @@ export class Federated extends Server {
const aggregator = new aggregators.MeanAggregator(undefined, 1, 'relative')

this.aggregators = this.aggregators.set(task, aggregator)
this.informants = this.informants.set(task, new AsyncInformant(aggregator))
this.rounds = this.rounds.set(task, 0)

void this.storeAggregationResult(task, aggregator)
Expand Down

0 comments on commit 7730c4a

Please sign in to comment.