Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Experiment] Remove Cuda #3817

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion core/src/banking_trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub struct BankingTracer {
#[cfg_attr(
feature = "frozen-abi",
derive(AbiExample),
frozen_abi(digest = "6PCDw6YSEivfbwhbPmE4NAsXb88ZX6hkFnruP8B38nma")
frozen_abi(digest = "Em9y1WuCEs1BYypWM8qLXmsiC4wEpgcxZQSmTf8kj8xT")
)]
#[derive(Serialize, Deserialize, Debug)]
pub struct TimedTracedEvent(pub std::time::SystemTime, pub TracedEvent);
Expand Down
16 changes: 0 additions & 16 deletions core/src/replay_stage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ use {
crossbeam_channel::{Receiver, RecvTimeoutError, Sender},
rayon::{prelude::*, ThreadPool},
solana_accounts_db::contains::Contains,
solana_entry::entry::VerifyRecyclers,
solana_geyser_plugin_manager::block_metadata_notifier_interface::BlockMetadataNotifierArc,
solana_gossip::cluster_info::ClusterInfo,
solana_ledger::{
Expand Down Expand Up @@ -601,7 +600,6 @@ impl ReplayStage {
rpc_subscriptions.clone(),
);
let run_replay = move || {
let verify_recyclers = VerifyRecyclers::default();
let _exit = Finalizer::new(exit.clone());
let mut identity_keypair = cluster_info.keypair().clone();
let mut my_pubkey = identity_keypair.pubkey();
Expand Down Expand Up @@ -730,7 +728,6 @@ impl ReplayStage {
transaction_status_sender.as_ref(),
cache_block_meta_sender.as_ref(),
entry_notification_sender.as_ref(),
&verify_recyclers,
&mut heaviest_subtree_fork_choice,
&replay_vote_sender,
&bank_notification_sender,
Expand Down Expand Up @@ -2243,7 +2240,6 @@ impl ReplayStage {
transaction_status_sender: Option<&TransactionStatusSender>,
entry_notification_sender: Option<&EntryNotifierSender>,
replay_vote_sender: &ReplayVoteSender,
verify_recyclers: &VerifyRecyclers,
log_messages_bytes_limit: Option<usize>,
prioritization_fee_cache: &PrioritizationFeeCache,
) -> result::Result<usize, BlockstoreProcessorError> {
Expand All @@ -2263,7 +2259,6 @@ impl ReplayStage {
transaction_status_sender,
entry_notification_sender,
Some(replay_vote_sender),
verify_recyclers,
false,
log_messages_bytes_limit,
prioritization_fee_cache,
Expand Down Expand Up @@ -2846,7 +2841,6 @@ impl ReplayStage {
progress: &mut ProgressMap,
transaction_status_sender: Option<&TransactionStatusSender>,
entry_notification_sender: Option<&EntryNotifierSender>,
verify_recyclers: &VerifyRecyclers,
replay_vote_sender: &ReplayVoteSender,
replay_timing: &mut ReplayLoopTiming,
log_messages_bytes_limit: Option<usize>,
Expand Down Expand Up @@ -2931,7 +2925,6 @@ impl ReplayStage {
transaction_status_sender,
entry_notification_sender,
&replay_vote_sender.clone(),
&verify_recyclers.clone(),
log_messages_bytes_limit,
prioritization_fee_cache,
);
Expand Down Expand Up @@ -2961,7 +2954,6 @@ impl ReplayStage {
progress: &mut ProgressMap,
transaction_status_sender: Option<&TransactionStatusSender>,
entry_notification_sender: Option<&EntryNotifierSender>,
verify_recyclers: &VerifyRecyclers,
replay_vote_sender: &ReplayVoteSender,
replay_timing: &mut ReplayLoopTiming,
log_messages_bytes_limit: Option<usize>,
Expand Down Expand Up @@ -3020,7 +3012,6 @@ impl ReplayStage {
transaction_status_sender,
entry_notification_sender,
&replay_vote_sender.clone(),
&verify_recyclers.clone(),
log_messages_bytes_limit,
prioritization_fee_cache,
);
Expand Down Expand Up @@ -3338,7 +3329,6 @@ impl ReplayStage {
transaction_status_sender: Option<&TransactionStatusSender>,
cache_block_meta_sender: Option<&CacheBlockMetaSender>,
entry_notification_sender: Option<&EntryNotifierSender>,
verify_recyclers: &VerifyRecyclers,
heaviest_subtree_fork_choice: &mut HeaviestSubtreeForkChoice,
replay_vote_sender: &ReplayVoteSender,
bank_notification_sender: &Option<BankNotificationSenderConfig>,
Expand Down Expand Up @@ -3386,7 +3376,6 @@ impl ReplayStage {
progress,
transaction_status_sender,
entry_notification_sender,
verify_recyclers,
replay_vote_sender,
replay_timing,
log_messages_bytes_limit,
Expand All @@ -3406,7 +3395,6 @@ impl ReplayStage {
progress,
transaction_status_sender,
entry_notification_sender,
verify_recyclers,
replay_vote_sender,
replay_timing,
log_messages_bytes_limit,
Expand Down Expand Up @@ -5007,7 +4995,6 @@ pub(crate) mod tests {
None,
None,
&replay_vote_sender,
&VerifyRecyclers::default(),
None,
&PrioritizationFeeCache::new(0u64),
);
Expand Down Expand Up @@ -8951,7 +8938,6 @@ pub(crate) mod tests {
// Set up bank0
let bank_forks = BankForks::new_rw_arc(Bank::new_for_tests(&genesis_config));
let bank0 = bank_forks.read().unwrap().get_with_scheduler(0).unwrap();
let recyclers = VerifyRecyclers::default();
let replay_tx_thread_pool = rayon::ThreadPoolBuilder::new()
.num_threads(1)
.thread_name(|i| format!("solReplayTx{i:02}"))
Expand All @@ -8963,7 +8949,6 @@ pub(crate) mod tests {
&blockstore,
&replay_tx_thread_pool,
&ProcessOptions::default(),
&recyclers,
None,
None,
);
Expand All @@ -8984,7 +8969,6 @@ pub(crate) mod tests {
&bank1,
&replay_tx_thread_pool,
&ProcessOptions::default(),
&recyclers,
&mut ConfirmationProgress::new(bank0.last_blockhash()),
None,
None,
Expand Down
20 changes: 4 additions & 16 deletions core/src/sigverify.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
//! The `sigverify` module provides digital signature verification functions.
//! By default, signatures are verified in parallel using all available CPU
//! cores. When perf-libs are available signature verification is offloaded
//! to the GPU.
//! cores.
//!

pub use solana_perf::sigverify::{
count_packets_in_batches, ed25519_verify_cpu, ed25519_verify_disabled, init, TxOffset,
count_packets_in_batches, ed25519_verify_cpu, ed25519_verify_disabled, TxOffset,
};
use {
crate::{
banking_trace::{BankingPacketBatch, BankingPacketSender},
sigverify_stage::{SigVerifier, SigVerifyServiceError},
},
solana_perf::{cuda_runtime::PinnedVec, packet::PacketBatch, recycler::Recycler, sigverify},
solana_perf::{packet::PacketBatch, sigverify},
solana_sdk::{packet::Packet, saturating_add_assign},
};

Expand Down Expand Up @@ -58,8 +57,6 @@ impl SigverifyTracerPacketStats {
pub struct TransactionSigVerifier {
packet_sender: BankingPacketSender,
tracer_packet_stats: SigverifyTracerPacketStats,
recycler: Recycler<TxOffset>,
recycler_out: Recycler<PinnedVec<u8>>,
reject_non_vote: bool,
}

Expand All @@ -71,12 +68,9 @@ impl TransactionSigVerifier {
}

pub fn new(packet_sender: BankingPacketSender) -> Self {
init();
Self {
packet_sender,
tracer_packet_stats: SigverifyTracerPacketStats::default(),
recycler: Recycler::warmed(50, 4096),
recycler_out: Recycler::warmed(50, 4096),
reject_non_vote: false,
}
}
Expand Down Expand Up @@ -139,13 +133,7 @@ impl SigVerifier for TransactionSigVerifier {
mut batches: Vec<PacketBatch>,
valid_packets: usize,
) -> Vec<PacketBatch> {
sigverify::ed25519_verify(
&mut batches,
&self.recycler,
&self.recycler_out,
self.reject_non_vote,
valid_packets,
);
sigverify::ed25519_verify(&mut batches, self.reject_non_vote, valid_packets);
batches
}
}
9 changes: 0 additions & 9 deletions core/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use {
},
rewards_recorder_service::{RewardsRecorderSender, RewardsRecorderService},
sample_performance_service::SamplePerformanceService,
sigverify,
snapshot_packager_service::{PendingSnapshotPackages, SnapshotPackagerService},
stats_reporter_service::StatsReporterService,
system_monitor_service::{
Expand Down Expand Up @@ -607,14 +606,6 @@ impl Validator {
info!("entrypoint: {:?}", cluster_entrypoint);
}

if solana_perf::perf_libs::api().is_some() {
info!("Initializing sigverify, this could take a while...");
} else {
info!("Initializing sigverify...");
}
sigverify::init();
info!("Initializing sigverify done.");

if !ledger_path.is_dir() {
return Err(anyhow!(
"ledger directory does not exist or is not accessible: {ledger_path:?}"
Expand Down
9 changes: 0 additions & 9 deletions docs/src/clusters/benchmark.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,6 @@ To run a multinode testnet, after starting a leader node, spin up some additiona
NDEBUG=1 ./multinode-demo/validator-x.sh
```

To run a performance-enhanced validator on Linux, [CUDA 10.0](https://developer.nvidia.com/cuda-downloads) must be installed on your system:

```bash
./fetch-perf-libs.sh
NDEBUG=1 SOLANA_CUDA=1 ./multinode-demo/bootstrap-validator.sh
NDEBUG=1 SOLANA_CUDA=1 ./multinode-demo/validator.sh
```


### Testnet Client Demo

Now that your singlenode or multinode testnet is up and running let's send it some transactions!
Expand Down
8 changes: 0 additions & 8 deletions docs/src/operations/guides/validator-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@ solana transaction-count
View the [metrics dashboard](https://metrics.solana.com:3000/d/monitor/cluster-telemetry) for more
detail on cluster activity.

## Enabling CUDA

If your machine has a GPU with CUDA installed \(Linux-only currently\), include
the `--cuda` argument to `agave-validator`.

When your validator is started look for the following log message to indicate
that CUDA is enabled: `"[<timestamp> solana::validator] CUDA is enabled"`

## System Tuning

### Linux
Expand Down
5 changes: 1 addition & 4 deletions entry/benches/entry_sigverify.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![feature(test)]
extern crate test;
use {
solana_entry::entry::{self, VerifyRecyclers},
solana_entry::entry::{self},
solana_perf::test_tx::test_tx,
solana_runtime_transaction::runtime_transaction::RuntimeTransaction,
solana_sdk::{
Expand Down Expand Up @@ -51,14 +51,11 @@ fn bench_gpusigverify(bencher: &mut Bencher) {
}
};

let recycler = VerifyRecyclers::default();

bencher.iter(|| {
let res = entry::start_verify_transactions(
entries.clone(),
false,
&thread_pool,
recycler.clone(),
Arc::new(verify_transaction),
);

Expand Down
Loading
Loading